From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id F20DE1B493 for ; Tue, 23 Oct 2018 13:52:59 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2018 04:52:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,416,1534834800"; d="scan'208";a="99935794" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.107]) by fmsmga004.fm.intel.com with SMTP; 23 Oct 2018 04:52:55 -0700 Received: by (sSMTP sendmail emulation); Tue, 23 Oct 2018 12:52:51 +0100 Date: Tue, 23 Oct 2018 12:52:51 +0100 From: Bruce Richardson To: Honnappa Nagarahalli Cc: pablo.de.lara.guarch@intel.com, dev@dpdk.org, yipeng1.wang@intel.com, gavin.hu@arm.com, dharmik.thakkar@arm.com, nd@arm.com Message-ID: <20181023115251.GD18800@bricha3-MOBL.ger.corp.intel.com> References: <1540268524-126673-1-git-send-email-honnappa.nagarahalli@arm.com> <1540268524-126673-5-git-send-email-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1540268524-126673-5-git-send-email-honnappa.nagarahalli@arm.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v5 4/5] hash: add lock-free read-write concurrency X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 11:53:00 -0000 On Mon, Oct 22, 2018 at 11:22:03PM -0500, Honnappa Nagarahalli wrote: > Add lock-free read-write concurrency. This is achieved by the > following changes. > > 1) Add memory ordering to avoid race conditions. The only race > condition that can occur is - using the key store element > before the key write is completed. Hence, while inserting the element > the release memory order is used. Any other race condition is caught > by the key comparison. Memory orderings are added only where needed. > For ex: reads in the writer's context do not need memory ordering > as there is a single writer. > > key_idx in the bucket entry and pdata in the key store element are > used for synchronisation. key_idx is used to release an inserted > entry in the bucket to the reader. Use of pdata for synchronisation > is required due to updation of an existing entry where-in only > the pdata is updated without updating key_idx. > > 2) Reader-writer concurrency issue, caused by moving the keys > to their alternative locations during key insert, is solved > by introducing a global counter(tbl_chng_cnt) indicating a > change in table. > > 3) Add the flag to enable reader-writer concurrency during > run time. > > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Gavin Hu > Reviewed-by: Ola Liljedahl > Reviewed-by: Steve Capper > Reviewed-by: Yipeng Wang > --- Acked-by: Bruce Richardson