Skip to contentSkip to conversation

kernel/locking: mutex: simplify access to the first entry in the wait-list

PATCH Superseded Andrzej Pietrasiewicz 5 participants 10 messages Dec 12, 2013 – Dec 14, 2013 Locking primitives

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kernel/locking: mutex: simplify access to the first entry in the wait-list

Use list_first_entry instead of explicitly accessing the first entry with "head".next. The comment one line above becomes obsolete.

---

v1..v2:

- corrected the email address in the second Signed-off-by line

 kernel/locking/mutex.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/locking/mutex.c +2 -3
index 4dd6e4c..4af4f9c 100644
@@ -730,10 +730,9 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
 		atomic_set(&lock->count, 1);
 
 	if (!list_empty(&lock->wait_list)) {
-		/* get the first entry from the wait-list: */
 		struct mutex_waiter *waiter =
-				list_entry(lock->wait_list.next,
-					   struct mutex_waiter, list);
+				list_first_entry(&lock->wait_list,
+						 struct mutex_waiter, list);
 
 		debug_mutex_wake_waiter(lock, waiter);
 
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw
Quoted 10 lines · Andrzej Pietrasiewicz

Use list_first_entry instead of explicitly accessing the first entry with "head".next. The comment one line above becomes obsolete.

---

v1..v2:

- corrected the email address in the second Signed-off-by line

Still invalid; the problem is that you appear to have written the patch (you send it and you have first sob).

So what is Kyungmin doing in the line? He did not send me your patch.

#2 lore raw
Quoted 20 lines

-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Thursday, December 12, 2013 8:35 PM
To: Andrzej Pietrasiewicz
Cc: [email protected]; Kyungmin Park; Marek Szyprowski; Ingo Molnar
Subject: Re: [PATCH v2] kernel/locking: mutex: simplify access to the first entry in the wait-list

Quoted 9 lines · Andrzej Pietrasiewicz

Use list_first_entry instead of explicitly accessing the first entry with "head".next. The comment one line above becomes obsolete.

---

v1..v2:

Quoted 7 lines
Quoted 1 line

- corrected the email address in the second Signed-off-by line

Still invalid; the problem is that you appear to have written the patch (you send it and you have first sob).

So what is Kyungmin doing in the line? He did not send me your patch.

Internal review process, and it represents this patch comes from.

Thank you,
Kyungmin Park

#3 lore raw
Quoted 22 lines · Kyungmin Park
Quoted 22 lines

-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Thursday, December 12, 2013 8:35 PM
To: Andrzej Pietrasiewicz
Cc: [email protected]; Kyungmin Park; Marek Szyprowski; Ingo Molnar
Subject: Re: [PATCH v2] kernel/locking: mutex: simplify access to the first entry in the wait-list

Quoted 10 lines · Andrzej Pietrasiewicz

Use list_first_entry instead of explicitly accessing the first entry with "head".next. The comment one line above becomes obsolete.

---

v1..v2:

- corrected the email address in the second Signed-off-by line

Quoted 7 lines
Quoted 5 lines

Still invalid; the problem is that you appear to have written the patch (you send it and you have first sob).

So what is Kyungmin doing in the line? He did not send me your patch.

Internal review process, and it represents this patch comes from.

That can be expressed via a Reviewed-by line.

Thanks,

Ingo

maintainer
#4 lore raw
In reply to Kyungmin Park
Quoted 22 lines · Kyungmin Park
Quoted 22 lines

-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Thursday, December 12, 2013 8:35 PM
To: Andrzej Pietrasiewicz
Cc: [email protected]; Kyungmin Park; Marek Szyprowski; Ingo Molnar
Subject: Re: [PATCH v2] kernel/locking: mutex: simplify access to the first entry in the wait-list

Quoted 10 lines · Andrzej Pietrasiewicz

Use list_first_entry instead of explicitly accessing the first entry with "head".next. The comment one line above becomes obsolete.

---

v1..v2:

- corrected the email address in the second Signed-off-by line

Quoted 7 lines
Quoted 5 lines

Still invalid; the problem is that you appear to have written the patch (you send it and you have first sob).

So what is Kyungmin doing in the line? He did not send me your patch.

Internal review process, and it represents this patch comes from.

For review we have this specific tag, oddly called: 'Reviewed-by'.

#5 lore raw

Hello Ingo & Peter,

I added Greg on Cc.

W dniu 12.12.2013 13:52, Peter Zijlstra pisze:

Quoted 11 lines · Kyungmin Park
Quoted 10 lines
Quoted 10 lines

-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Thursday, December 12, 2013 8:35 PM
To: Andrzej Pietrasiewicz
Cc: [email protected]; Kyungmin Park; Marek Szyprowski; Ingo Molnar
Subject: Re: [PATCH v2] kernel/locking: mutex: simplify access to the first entry in the wait-list

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Andrzej Pietrasiewicz
Quoted 6 lines

Use list_first_entry instead of explicitly accessing the first entry with "head".next. The comment one line above becomes obsolete.

---

For quite a long time I've been sending the same SOB lines to the linux-usb list.

Can you please refer here:

http://www.spinics.net/lists/linux-usb/msg74981.html

Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

v1..v2:

- corrected the email address in the second Signed-off-by line

Quoted 7 lines
Quoted 5 lines

Still invalid; the problem is that you appear to have written the patch (you send it and you have first sob).

So what is Kyungmin doing in the line? He did not send me your patch.

Internal review process, and it represents this patch comes from.

For review we have this specific tag, oddly called: 'Reviewed-by'.

maintainer
#6 lore raw
Quoted 6 lines · Andrzej Pietrasiewicz

Hello Ingo & Peter,

I added Greg on Cc.

For quite a long time I've been sending the same SOB lines to the linux-usb list.

Then Greg is more forgiving. Doesn't make it right though.

#7 lore raw
Quoted 9 lines · Peter Zijlstra
Quoted 6 lines · Andrzej Pietrasiewicz

Hello Ingo & Peter,

I added Greg on Cc.

For quite a long time I've been sending the same SOB lines to the linux-usb list.

Then Greg is more forgiving. Doesn't make it right though.

Also, it's easy to not notice, and it has no testable side effects.

Yet if mistakes _are_ noticed like in this case then the inconsistency should be fixed, as the SOB chains have specific meaning.

Thanks,

Ingo

#8 lore raw
In reply to Peter Zijlstra
Quoted 9 lines · Peter Zijlstra
Quoted 6 lines · Andrzej Pietrasiewicz

Hello Ingo & Peter,

I added Greg on Cc.

For quite a long time I've been sending the same SOB lines to the linux-usb list.

Then Greg is more forgiving. Doesn't make it right though.

I usually make sure the one sending me the patch is the "last" on the chain, if not, that's a mistake on my part when I take the patch, sorry.

greg k-h

#9 lore raw
In reply to Andrzej Pietrasiewicz
Quoted 20 lines · Andrzej Pietrasiewicz

Hello Ingo & Peter,

I added Greg on Cc.

W dniu 12.12.2013 13:52, Peter Zijlstra pisze:

Quoted 15 lines · Kyungmin Park
Quoted 14 lines
Quoted 14 lines

-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Thursday, December 12, 2013 8:35 PM
To: Andrzej Pietrasiewicz
Cc: [email protected]; Kyungmin Park; Marek Szyprowski; Ingo Molnar
Subject: Re: [PATCH v2] kernel/locking: mutex: simplify access to the first entry in the wait-list

Quoted 3 lines · Andrzej Pietrasiewicz

Use list_first_entry instead of explicitly accessing the first entry with "head".next. The comment one line above becomes obsolete.

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

---

For quite a long time I've been sending the same SOB lines to the linux-usb list.

They can slip through the cracks - but in the past Linus has complained about such SOB sequences so it's a real concern.

SOB has a very specific purpose outlined in Documentation/SubmittingPatches, please use Reviewed-by or other methods of adding credit to others.

Of course if you write a patch and Kyungmin sends me the patch then that signoff sequence is completely valid.

Thanks,

Ingo