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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 Jan 2022 18:06:25 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Liam Howlett <liam.howlett@...cle.com>,
        "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Song Liu <songliubraving@...com>,
        Davidlohr Bueso <dave@...olabs.net>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Laurent Dufour <ldufour@...ux.ibm.com>,
        David Rientjes <rientjes@...gle.com>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Rik van Riel <riel@...riel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Michel Lespinasse <walken.cr@...il.com>,
        Jerome Glisse <jglisse@...hat.com>,
        Minchan Kim <minchan@...gle.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Rom Lemarchand <romlem@...gle.com>
Subject: Re: [PATCH v4 64/66] nommu: Remove uses of VMA linked list

On 1/20/22 16:54, Matthew Wilcox wrote:
> On Thu, Jan 20, 2022 at 04:06:21PM +0100, Vlastimil Babka wrote:
>> On 12/1/21 15:30, Liam Howlett wrote:
>> > From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
>> > 
>> > Use the maple tree or VMA iterator instead.  This is faster and will
>> > allow us to shrink the VMA.
>> > 
>> > Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
>> > Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
>> 
>> Acked-by: Vlastimil Babka <vbabka@...e.cz>
>> 
>> But I think some fixup needed:
>> 
>> > @@ -1456,12 +1458,14 @@ void exit_mmap(struct mm_struct *mm)
>> >  
>> >  	mm->total_vm = 0;
>> >  
>> > -	while ((vma = mm->mmap)) {
>> > -		mm->mmap = vma->vm_next;
>> > +	mmap_write_lock(mm);
>> 
>> If locking was missing, should have been added sooner than now?
> 
> I don't think so?  This is the exit_mmap() path, so we know nobody
> has access to the mm.  We didn't need to hold the lock at this point
> before, but now for_each_vma() will check we're holding the mmap_lock.

It has crossed my mind that it is there to make asserts happy, in which case
a clarifying comment would be useful.

>> > +	for_each_vma(vmi, vma) {
>> >  		delete_vma_from_mm(vma);
>> >  		delete_vma(mm, vma);
>> >  		cond_resched();
>> >  	}
>> > +	__mt_destroy(&mm->mm_mt);
>> 
>> And this at the point mm_mt was added?
> 
> You mean we should have been calling __mt_destroy() earlier in the
> patch series?

Yeah.

> Umm ... I'll defer to Liam on that one.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ