lkml.org 
[lkml]   [2018]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 2/2] locking/percpu-rwsem: Mark rwsem as non-spinnable in percpu_rwsem_release()
On 05/15, Jan Kara wrote:
>
> Now this behavior upsets lockdep and that's why we fool it by telling the
> semaphore got released before returning to userspace (through
> percpu_rwsem_release() helper) and similarly we tell lockdep we've got the
> semaphore when an unfreeze syscall is called by percpu_rwsem_acquire(). Now
> Amir has discovered that also rwsem debugging code gets confused by this
> behavior

Yes, plus someone else has already reported the problem a month ago,

> and previously also someone noticed that rwsem spinning does not
> make sense and can be broken by this behavior.

Well, this doesn't really matter but again, freeze_super() checks
frozen == SB_UNFROZEN under sb->s_umount and only then does sb_wait_write(),
when the previous writer has already realeased this lock. So the new writer
will never spin after lockdep_sb_freeze_release() clears ->owner.

Oleg.

\
 
 \ /
  Last update: 2018-05-15 13:33    [W:0.056 / U:6.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site