[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d0e528e-7777-9333-d0dc-b49ce9a746e0@suse.cz>
Date: Wed, 19 Jan 2022 17:44:05 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: 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>
Cc: 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 45/66] acct: Use VMA iterator instead of linked list
On 12/1/21 15:30, Liam Howlett wrote:
> From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
>
> The VMA iterator is faster than the linked list.
>
> 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>
> ---
> kernel/acct.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/acct.c b/kernel/acct.c
> index 3df53cf1dcd5..2e7bf8d41f04 100644
> --- a/kernel/acct.c
> +++ b/kernel/acct.c
> @@ -535,15 +535,14 @@ void acct_collect(long exitcode, int group_dead)
> unsigned long vsize = 0;
>
> if (group_dead && current->mm) {
> + struct mm_struct *mm = current->mm;
> + VMA_ITERATOR(vmi, mm, 0);
> struct vm_area_struct *vma;
>
> - mmap_read_lock(current->mm);
> - vma = current->mm->mmap;
> - while (vma) {
> + mmap_read_lock(mm);
> + for_each_vma(vmi, vma)
> vsize += vma->vm_end - vma->vm_start;
> - vma = vma->vm_next;
> - }
> - mmap_read_unlock(current->mm);
> + mmap_read_unlock(mm);
> }
>
> spin_lock_irq(¤t->sighand->siglock);
Powered by blists - more mailing lists