lkml.org 
[lkml]   [2019]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH-tip v2 02/10] locking/rwsem: Move owner setting code from rwsem.c to rwsem.h
Hi Waiman,

On Fri, Feb 15, 2019 at 03:50:02PM -0500, Waiman Long wrote:
> Moves all the owner setting code closer to the rwsem-xadd fast paths
> directly within rwsem.h file.
>
> For __down_read() and __down_read_killable(), it is assumed that
> rwsem will be marked as reader-owned when the functions return. That
> is currently true except in the transient case that the waiter queue
> just becomes empty. So a rwsem_set_reader_owned() call is added for
> this case.

Sorry, but I'm having a really hard time understanding the paragraph
above. You make it sound like you're fixing a bug here, but that doesn't
appear to be the case. Please can you elaborate?

> The __rwsem_set_reader_owned() call in __rwsem_mark_wake()
> is now necessary.
>
> Signed-off-by: Waiman Long <longman@redhat.com>
> ---
> kernel/locking/rwsem-xadd.c | 6 +++---
> kernel/locking/rwsem.c | 19 ++-----------------
> kernel/locking/rwsem.h | 17 +++++++++++++++--
> 3 files changed, 20 insertions(+), 22 deletions(-)

I personally find the existing code easier to read, but I don't know if
that's just because I'm used to it...

Will

\
 
 \ /
  Last update: 2019-02-21 15:16    [W:0.094 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site