[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <699d9f0c-e330-f651-a6c8-f9e11e1844fd@suse.cz>
Date: Wed, 19 Jan 2022 12:10:06 +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 41/66] fs/proc/base: Use maple tree iterators in place
of linked list
On 12/1/21 15:30, Liam Howlett wrote:
> From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
Acked-by: Vlastimil Babka <vbabka@...e.cz>
> ---
> fs/proc/base.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 13eda8de2998..ea17ee988158 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2323,6 +2323,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx)
> GENRADIX(struct map_files_info) fa;
> struct map_files_info *p;
> int ret;
> + MA_STATE(mas, NULL, 0, 0);
>
> genradix_init(&fa);
>
> @@ -2350,6 +2351,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx)
> }
>
> nr_files = 0;
> + mas.tree = &mm->mm_mt;
>
> /*
> * We need two passes here:
> @@ -2361,7 +2363,8 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx)
> * routine might require mmap_lock taken in might_fault().
> */
>
> - for (vma = mm->mmap, pos = 2; vma; vma = vma->vm_next) {
> + pos = 2;
> + mas_for_each(&mas, vma, ULONG_MAX) {
> if (!vma->vm_file)
> continue;
> if (++pos <= ctx->pos)
Powered by blists - more mailing lists