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: <20220125163806.bhepto3ccl4xnqef@revolver>
Date:   Tue, 25 Jan 2022 16:38:22 +0000
From:   Liam Howlett <liam.howlett@...cle.com>
To:     Vlastimil Babka <vbabka@...e.cz>
CC:     "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>,
        Matthew Wilcox <willy@...radead.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 36/66] um: Remove vma linked list walk

* Vlastimil Babka <vbabka@...e.cz> [220118 13:41]:
> On 12/1/21 15:30, Liam Howlett wrote:
> > From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
> > 
> > Use the VMA iterator instead.
> > 
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> > ---
> >  arch/um/kernel/tlb.c | 14 ++++++--------
> >  1 file changed, 6 insertions(+), 8 deletions(-)
> > 
> > diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
> > index bc38f79ca3a3..25f043037d76 100644
> > --- a/arch/um/kernel/tlb.c
> > +++ b/arch/um/kernel/tlb.c
> > @@ -584,21 +584,19 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
> >  
> >  void flush_tlb_mm(struct mm_struct *mm)
> >  {
> > -	struct vm_area_struct *vma = mm->mmap;
> > +	struct vm_area_struct *vma;
> > +	VMA_ITERATOR(vmi, mm, 0);
> >  
> > -	while (vma != NULL) {
> > +	for_each_vma(vmi, vma)
> >  		fix_range(mm, vma->vm_start, vma->vm_end, 0);
> > -		vma = vma->vm_next;
> > -	}
> >  }
> >  
> >  void force_flush_all(void)
> >  {
> >  	struct mm_struct *mm = current->mm;
> > -	struct vm_area_struct *vma = mm->mmap;
> > +	struct vm_area_struct *vma;
> > +	MA_STATE(mas, &mm->mm_mt, 0, 0);
> >  
> > -	while (vma != NULL) {
> > +	mas_for_each(&mas, vma, ULONG_MAX)
> 
> Is there a reason to use the iterator in one case and mas_for_each in the other?

No, I will changed the second one to the vma iterator.  Thanks.

> 
> >  		fix_range(mm, vma->vm_start, vma->vm_end, 1);
> > -		vma = vma->vm_next;
> > -	}
> >  }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ