lkml.org 
[lkml]   [2020]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 01/10] mmap locking API: initial implementation as rwsem wrappers
On Tue, 14 Apr 2020, Michel Lespinasse wrote:

>This change wraps the existing mmap_sem related rwsem calls into a new
>mmap locking API. There are two justifications for the new API:
>
>- At first, it provides an easy hooking point to instrument mmap_sem
> locking latencies independently of any other rwsems.
>
>- In the future, it may be a starting point for replacing the rwsem
> implementation with a different one, such as range locks.
>
>Signed-off-by: Michel Lespinasse <walken@google.com>
>Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>

Reviewed-by: Davidlohr Bueso <dbueso@suse.de>

With one observation below.

>+static inline void mmap_downgrade_write_lock(struct mm_struct *mm)
>+{
>+ downgrade_write(&mm->mmap_sem);
>+}

Shouldn't this really be just mmap_downgrade_write()? In locking
normally don't add the _lock at the end as it implies the operation
of acquiring the lock.

Thanks,
Davidlohr

\
 
 \ /
  Last update: 2020-04-20 21:52    [W:0.154 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site