DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
@ 2019-11-21 18:17 Dharmik Thakkar
  2019-11-25 18:49 ` Wang, Yipeng1
  0 siblings, 1 reply; 9+ messages in thread
From: Dharmik Thakkar @ 2019-11-21 18:17 UTC (permalink / raw)
  To: Yipeng Wang, Sameh Gobriel, Bruce Richardson
  Cc: dev, honnappa.nagarahalli, Dharmik Thakkar

Remove __hash_rw_reader_unlock() calls from lock free hash lookup

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 lib/librte_hash/rte_cuckoo_hash.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 87a4c01f2f9e..1a4795c82321 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -1285,10 +1285,8 @@ __rte_hash_lookup_with_hash_lf(const struct rte_hash *h, const void *key,
 		/* Check if key is in primary location */
 		bkt = &h->buckets[prim_bucket_idx];
 		ret = search_one_bucket_lf(h, key, short_sig, data, bkt);
-		if (ret != -1) {
-			__hash_rw_reader_unlock(h);
+		if (ret != -1)
 			return ret;
-		}
 		/* Calculate secondary hash */
 		bkt = &h->buckets[sec_bucket_idx];
 
@@ -1296,10 +1294,8 @@ __rte_hash_lookup_with_hash_lf(const struct rte_hash *h, const void *key,
 		FOR_EACH_BUCKET(cur_bkt, bkt) {
 			ret = search_one_bucket_lf(h, key, short_sig,
 						data, cur_bkt);
-			if (ret != -1) {
-				__hash_rw_reader_unlock(h);
+			if (ret != -1)
 				return ret;
-			}
 		}
 
 		/* The loads of sig_current in search_one_bucket
-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-21 18:17 [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free Dharmik Thakkar
@ 2019-11-25 18:49 ` Wang, Yipeng1
  2019-11-25 21:54   ` Thomas Monjalon
  2020-01-19 23:37   ` Thomas Monjalon
  0 siblings, 2 replies; 9+ messages in thread
From: Wang, Yipeng1 @ 2019-11-25 18:49 UTC (permalink / raw)
  To: Dharmik Thakkar, Gobriel, Sameh, Richardson, Bruce
  Cc: dev, honnappa.nagarahalli

>-----Original Message-----
>From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
>Sent: Thursday, November 21, 2019 10:18 AM
>To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@intel.com>; Richardson, Bruce
><bruce.richardson@intel.com>
>Cc: dev@dpdk.org; honnappa.nagarahalli@arm.com; Dharmik Thakkar <dharmik.thakkar@arm.com>
>Subject: [PATCH] lib/hash: remove unnecessary locks in lock-free
>
>Remove __hash_rw_reader_unlock() calls from lock free hash lookup
>
>Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>Reviewed-by: Gavin Hu <gavin.hu@arm.com>
>Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>---
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>

Thanks for the patch!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-25 18:49 ` Wang, Yipeng1
@ 2019-11-25 21:54   ` Thomas Monjalon
  2019-11-25 22:02     ` Wang, Yipeng1
  2020-01-19 23:37   ` Thomas Monjalon
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2019-11-25 21:54 UTC (permalink / raw)
  To: Wang, Yipeng1, Dharmik Thakkar
  Cc: dev, Gobriel, Sameh, Richardson, Bruce, honnappa.nagarahalli

25/11/2019 19:49, Wang, Yipeng1:
> >-----Original Message-----
> >From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
> >Sent: Thursday, November 21, 2019 10:18 AM
> >To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@intel.com>; Richardson, Bruce
> ><bruce.richardson@intel.com>
> >Cc: dev@dpdk.org; honnappa.nagarahalli@arm.com; Dharmik Thakkar <dharmik.thakkar@arm.com>
> >Subject: [PATCH] lib/hash: remove unnecessary locks in lock-free
> >
> >Remove __hash_rw_reader_unlock() calls from lock free hash lookup
> >
> >Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> >Reviewed-by: Gavin Hu <gavin.hu@arm.com>
> >Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> >---
> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
> 
> Thanks for the patch!

Excuse me, there is no motivation (the why) in this patch.
Is it critical? which gain?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-25 21:54   ` Thomas Monjalon
@ 2019-11-25 22:02     ` Wang, Yipeng1
  2019-11-25 22:44       ` Thomas Monjalon
  0 siblings, 1 reply; 9+ messages in thread
From: Wang, Yipeng1 @ 2019-11-25 22:02 UTC (permalink / raw)
  To: Thomas Monjalon, Dharmik Thakkar
  Cc: dev, Gobriel, Sameh, Richardson, Bruce, honnappa.nagarahalli

>-----Original Message-----
>From: Thomas Monjalon [mailto:thomas@monjalon.net]
>Sent: Monday, November 25, 2019 1:55 PM
>To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Dharmik Thakkar <dharmik.thakkar@arm.com>
>Cc: dev@dpdk.org; Gobriel, Sameh <sameh.gobriel@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>;
>honnappa.nagarahalli@arm.com
>Subject: Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
>
>25/11/2019 19:49, Wang, Yipeng1:
>> >-----Original Message-----
>> >From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
>> >Sent: Thursday, November 21, 2019 10:18 AM
>> >To: Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@intel.com>; Richardson, Bruce
>> ><bruce.richardson@intel.com>
>> >Cc: dev@dpdk.org; honnappa.nagarahalli@arm.com; Dharmik Thakkar <dharmik.thakkar@arm.com>
>> >Subject: [PATCH] lib/hash: remove unnecessary locks in lock-free
>> >
>> >Remove __hash_rw_reader_unlock() calls from lock free hash lookup
>> >
>> >Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>> >Reviewed-by: Gavin Hu <gavin.hu@arm.com>
>> >Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>> >---
>> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
>>
>> Thanks for the patch!
>
>Excuse me, there is no motivation (the why) in this patch.
>Is it critical? which gain?
>
[Wang, Yipeng] 
Thomas, do you mean the commit message is not clear enough?
I think it is self-explained that in the "lock-free" implementation, we don't need
"read_unlock()" and the subject line also says that.
But it is always better to be more explicit.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-25 22:02     ` Wang, Yipeng1
@ 2019-11-25 22:44       ` Thomas Monjalon
  2019-11-25 22:55         ` Dharmik Thakkar
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2019-11-25 22:44 UTC (permalink / raw)
  To: Wang, Yipeng1
  Cc: Dharmik Thakkar, dev, Gobriel, Sameh, Richardson, Bruce,
	honnappa.nagarahalli

25/11/2019 23:02, Wang, Yipeng1:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> >25/11/2019 19:49, Wang, Yipeng1:
> >> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
> >> >
> >> >Remove __hash_rw_reader_unlock() calls from lock free hash lookup
> >> >
> >> >Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> >> >Reviewed-by: Gavin Hu <gavin.hu@arm.com>
> >> >Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> >> >---
> >> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
> >>
> >> Thanks for the patch!
> >
> >Excuse me, there is no motivation (the why) in this patch.
> >Is it critical? which gain?
> >
> [Wang, Yipeng] 
> Thomas, do you mean the commit message is not clear enough?
> I think it is self-explained that in the "lock-free" implementation, we don't need
> "read_unlock()" and the subject line also says that.
> But it is always better to be more explicit.

I understand that it is not needed.
But it doesn't say what is the impact of having this unlock.
Is there a real performance impact?
Is it critical enough to be merged in 19.11-rc4?
If it is not candidate for 19.11, it is better to prepend the title with [20.02].



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-25 22:44       ` Thomas Monjalon
@ 2019-11-25 22:55         ` Dharmik Thakkar
  2019-11-25 23:14           ` Thomas Monjalon
  0 siblings, 1 reply; 9+ messages in thread
From: Dharmik Thakkar @ 2019-11-25 22:55 UTC (permalink / raw)
  To: thomas
  Cc: Wang, Yipeng1, dev, Gobriel, Sameh, Richardson, Bruce,
	Honnappa Nagarahalli



> On Nov 25, 2019, at 4:44 PM, Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 25/11/2019 23:02, Wang, Yipeng1:
>> From: Thomas Monjalon [mailto:thomas@monjalon.net]
>>> 25/11/2019 19:49, Wang, Yipeng1:
>>>> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
>>>>>
>>>>> Remove __hash_rw_reader_unlock() calls from lock free hash lookup
>>>>>
>>>>> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>>>>> Reviewed-by: Gavin Hu <gavin.hu@arm.com>
>>>>> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>>>>> ---
>>>> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
>>>>
>>>> Thanks for the patch!
>>>
>>> Excuse me, there is no motivation (the why) in this patch.
>>> Is it critical? which gain?
>>>
>> [Wang, Yipeng]
>> Thomas, do you mean the commit message is not clear enough?
>> I think it is self-explained that in the "lock-free" implementation, we don't need
>> "read_unlock()" and the subject line also says that.
>> But it is always better to be more explicit.
>
> I understand that it is not needed.
> But it doesn't say what is the impact of having this unlock.
> Is there a real performance impact?
> Is it critical enough to be merged in 19.11-rc4?
> If it is not candidate for 19.11, it is better to prepend the title with [20.02].
>
Thomas, I don’t think there is any performance impact. This is more of a clean-up patch.
It is not critical as those “read_unlock()” don’t cause any error.
Should I update the patch title with [20.02]?
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-25 22:55         ` Dharmik Thakkar
@ 2019-11-25 23:14           ` Thomas Monjalon
  2020-01-17 16:42             ` Dharmik Thakkar
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2019-11-25 23:14 UTC (permalink / raw)
  To: Dharmik Thakkar
  Cc: Wang, Yipeng1, dev, Gobriel, Sameh, Richardson, Bruce,
	Honnappa Nagarahalli

25/11/2019 23:55, Dharmik Thakkar:
> 
> > On Nov 25, 2019, at 4:44 PM, Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > 25/11/2019 23:02, Wang, Yipeng1:
> >> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> >>> 25/11/2019 19:49, Wang, Yipeng1:
> >>>> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
> >>>>>
> >>>>> Remove __hash_rw_reader_unlock() calls from lock free hash lookup
> >>>>>
> >>>>> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> >>>>> Reviewed-by: Gavin Hu <gavin.hu@arm.com>
> >>>>> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> >>>>> ---
> >>>> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
> >>>>
> >>>> Thanks for the patch!
> >>>
> >>> Excuse me, there is no motivation (the why) in this patch.
> >>> Is it critical? which gain?
> >>>
> >> [Wang, Yipeng]
> >> Thomas, do you mean the commit message is not clear enough?
> >> I think it is self-explained that in the "lock-free" implementation, we don't need
> >> "read_unlock()" and the subject line also says that.
> >> But it is always better to be more explicit.
> >
> > I understand that it is not needed.
> > But it doesn't say what is the impact of having this unlock.
> > Is there a real performance impact?
> > Is it critical enough to be merged in 19.11-rc4?
> > If it is not candidate for 19.11, it is better to prepend the title with [20.02].
> >
> Thomas, I don’t think there is any performance impact. This is more of a clean-up patch.
> It is not critical as those “read_unlock()” don’t cause any error.
> Should I update the patch title with [20.02]?

No that's fine, it's clear now.
Thank you



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-25 23:14           ` Thomas Monjalon
@ 2020-01-17 16:42             ` Dharmik Thakkar
  0 siblings, 0 replies; 9+ messages in thread
From: Dharmik Thakkar @ 2020-01-17 16:42 UTC (permalink / raw)
  To: thomas
  Cc: Wang, Yipeng1, dev, Gobriel, Sameh, Richardson, Bruce,
	Honnappa Nagarahalli

Hi Thomas,
Can this patch be merged?

> On Nov 25, 2019, at 5:14 PM, Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 25/11/2019 23:55, Dharmik Thakkar:
>>
>>> On Nov 25, 2019, at 4:44 PM, Thomas Monjalon <thomas@monjalon.net> wrote:
>>>
>>> 25/11/2019 23:02, Wang, Yipeng1:
>>>> From: Thomas Monjalon [mailto:thomas@monjalon.net]
>>>>> 25/11/2019 19:49, Wang, Yipeng1:
>>>>>> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
>>>>>>>
>>>>>>> Remove __hash_rw_reader_unlock() calls from lock free hash lookup
>>>>>>>
>>>>>>> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>>>>>>> Reviewed-by: Gavin Hu <gavin.hu@arm.com>
>>>>>>> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>>>>>>> ---
>>>>>> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
>>>>>>
>>>>>> Thanks for the patch!
>>>>>
>>>>> Excuse me, there is no motivation (the why) in this patch.
>>>>> Is it critical? which gain?
>>>>>
>>>> [Wang, Yipeng]
>>>> Thomas, do you mean the commit message is not clear enough?
>>>> I think it is self-explained that in the "lock-free" implementation, we don't need
>>>> "read_unlock()" and the subject line also says that.
>>>> But it is always better to be more explicit.
>>>
>>> I understand that it is not needed.
>>> But it doesn't say what is the impact of having this unlock.
>>> Is there a real performance impact?
>>> Is it critical enough to be merged in 19.11-rc4?
>>> If it is not candidate for 19.11, it is better to prepend the title with [20.02].
>>>
>> Thomas, I don’t think there is any performance impact. This is more of a clean-up patch.
>> It is not critical as those “read_unlock()” don’t cause any error.
>> Should I update the patch title with [20.02]?
>
> No that's fine, it's clear now.
> Thank you

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free
  2019-11-25 18:49 ` Wang, Yipeng1
  2019-11-25 21:54   ` Thomas Monjalon
@ 2020-01-19 23:37   ` Thomas Monjalon
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2020-01-19 23:37 UTC (permalink / raw)
  To: Dharmik Thakkar
  Cc: Gobriel, Sameh, Richardson, Bruce, dev, honnappa.nagarahalli,
	Wang, Yipeng1

25/11/2019 19:49, Wang, Yipeng1:
>From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com]
> >Remove __hash_rw_reader_unlock() calls from lock free hash lookup
> >
> >Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> >Reviewed-by: Gavin Hu <gavin.hu@arm.com>
> >Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> >---
> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>

Applied, thanks



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 18:17 [dpdk-dev] [PATCH] lib/hash: remove unnecessary locks in lock-free Dharmik Thakkar
2019-11-25 18:49 ` Wang, Yipeng1
2019-11-25 21:54   ` Thomas Monjalon
2019-11-25 22:02     ` Wang, Yipeng1
2019-11-25 22:44       ` Thomas Monjalon
2019-11-25 22:55         ` Dharmik Thakkar
2019-11-25 23:14           ` Thomas Monjalon
2020-01-17 16:42             ` Dharmik Thakkar
2020-01-19 23:37   ` Thomas Monjalon

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox