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 C37971B276 for ; Sat, 13 Oct 2018 04:32:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2018 19:32:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,375,1534834800"; d="scan'208";a="98822351" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 12 Oct 2018 19:32:55 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 12 Oct 2018 19:32:54 -0700 Received: from fmsmsx151.amr.corp.intel.com ([169.254.7.87]) by fmsmsx101.amr.corp.intel.com ([169.254.1.139]) with mapi id 14.03.0319.002; Fri, 12 Oct 2018 19:32:54 -0700 From: "Wang, Yipeng1" To: Honnappa Nagarahalli , "Richardson, Bruce" , "De Lara Guarch, Pablo" CC: "dev@dpdk.org" , "dharmik.thakkar@arm.com" , "gavin.hu@arm.com" , "nd@arm.com" , "Gobriel, Sameh" Thread-Topic: [PATCH v3 6/7] hash: enable lock-free reader-writer concurrency Thread-Index: AQHUYfVR11nyBdO0bUmCViYz6/TUQqUcb0cA Date: Sat, 13 Oct 2018 02:32:53 +0000 Message-ID: References: <1539325918-125438-1-git-send-email-honnappa.nagarahalli@arm.com> <1539325918-125438-7-git-send-email-honnappa.nagarahalli@arm.com> In-Reply-To: <1539325918-125438-7-git-send-email-honnappa.nagarahalli@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDQ5NDdlZDYtNDUwYi00NzYxLTg2MmUtNjA3ZGJiNjQzOWU3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibmNJUzY1OENRVDZwNExCSTNEQUh4Mk5QVnIySUJEZmZvUjg5UDlxR3BVcU5GTGQ0RnlWSFhBYk5McVdUR0htbSJ9 x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 6/7] hash: enable lock-free reader-writer 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: Sat, 13 Oct 2018 02:32:57 -0000 >-----Original Message----- >From: Honnappa Nagarahalli [mailto:honnappa.nagarahalli@arm.com] >Sent: Thursday, October 11, 2018 11:32 PM >To: Richardson, Bruce ; De Lara Guarch, Pablo = >Cc: dev@dpdk.org; Wang, Yipeng1 ; honnappa.nagarah= alli@arm.com; dharmik.thakkar@arm.com; >gavin.hu@arm.com; nd@arm.com >Subject: [PATCH v3 6/7] hash: enable lock-free reader-writer concurrency > >Add the flag to enable reader-writer concurrency during >run time. The rte_hash_del_xxx APIs do not free the keystore >element when this flag is enabled. Hence a new API, >rte_hash_free_key_with_position, to free the key store element >is added. > >Signed-off-by: Honnappa Nagarahalli >Reviewed-by: Gavin Hu >Reviewed-by: Ola Liljedahl >Reviewed-by: Steve Capper >Reviewed-by: Yipeng Wang > >+/** Flag to support lock free reader writer concurrency. Writer can be >+ * single writer/multi writer. [Wang, Yipeng] "Writer can be multi-writer when the RTE_HASH_EXTRA_FLAGS_MU= LTI_WRITER_ADD flag is also set." >+ * Currently, extended bucket table feature is not supported with [Wang, Yipeng] "extendable bucket table", I also used wrong name sometimes = but please use this one. >@@ -156,6 +169,10 @@ rte_hash_count(const struct rte_hash *h); > * and should only be called from one thread by default. > * Thread safety can be enabled by setting flag during > * table creation. >+ * The writer needs to be aware if this API is called to update >+ * an existing entry. The application should free any memory >+ * allocated for the existing 'data' only after all the readers >+ * have stopped referrencing it. > * [Wang, Yipeng]=20 This comment to me is assuming a specific user use case, and not the librar= y's responsibility. How about a more general description: If the added key is already in the table, the function will update the data= of the key. In such case, it is the user's responsibility to properly handle the old da= ta if the old data is still being referenced by other threads. Please let me know if I understand it wrong.