lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANN689H1VjW4aC8HuLEtb8YrVyAJ0t6OVM6w2_o1+P2=9Mt6Gw@mail.gmail.com>
Date:   Mon, 6 Apr 2020 08:35:03 -0700
From:   Michel Lespinasse <walken@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-mm <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Laurent Dufour <ldufour@...ux.ibm.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Matthew Wilcox <willy@...radead.org>,
        Liam Howlett <Liam.Howlett@...cle.com>,
        Jerome Glisse <jglisse@...hat.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        David Rientjes <rientjes@...gle.com>,
        Hugh Dickins <hughd@...gle.com>, Ying Han <yinghan@...gle.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Markus Elfring <Markus.Elfring@....de>
Subject: Re: [PATCH v3 06/10] mmap locking API: convert nested write lock sites

On Wed, Apr 1, 2020 at 6:42 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Fri, Mar 27, 2020 at 03:50:58PM -0700, Michel Lespinasse wrote:
>
> > @@ -26,6 +31,12 @@ static inline void mmap_write_unlock(struct mm_struct *mm)
> >       up_write(&mm->mmap_sem);
> >  }
> >
> > +/* Pairs with mmap_write_lock_nested() */
> > +static inline void mmap_write_unlock_nested(struct mm_struct *mm)
> > +{
> > +     up_write(&mm->mmap_sem);
> > +}
> > +
> >  static inline void mmap_downgrade_write_lock(struct mm_struct *mm)
> >  {
> >       downgrade_write(&mm->mmap_sem);
>
> Why does unlock_nested() make sense ?

I thought it would make things more explicit to match the nested lock
with the corresponding unlock site; however this information is not
used at the moment (i.e. the nested unlock is implemented identically
to the regular unlock).

Having the matching sites explicitly identified may help when
implementing lock instrumentation, or when changing the lock type
(another patchset I am working on needs to pass an explicit lock range
to the nested lock and unlock sites).

I'll admit this is not a super strong argument, and can be deferred to
when an actual need shows up in the future.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ