Re: [PATCH] fs/aio: Stop allocating aio rings from HIGHMEM

From: Ira Weiny
Date: Tue Jun 13 2023 - 16:12:59 EST


Fabio M. De Francesco wrote:
> There is no need to allocate aio rings from HIGHMEM because of very
> little memory needed here.
>
> Therefore, use GFP_USER flag in find_or_create_page() and get rid of
> kmap*() mappings.
>
> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> Cc: Ira Weiny <ira.weiny@xxxxxxxxx>
> Suggested-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@xxxxxxxxx>
> ---
> fs/aio.c | 26 +++++++++-----------------
> 1 file changed, 9 insertions(+), 17 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index b0b17bd098bb..77e33619de40 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c

[snip]

> @@ -1250,10 +1244,9 @@ static long aio_read_events_ring(struct kioctx *ctx,
> avail = min(avail, nr - ret);
> avail = min_t(long, avail, AIO_EVENTS_PER_PAGE - pos);
>
> - ev = kmap(page);
> + ev = page_address(page);

NIT: This might be cleaner to remove the temp variable;

ev = page_address(ctx->ring_pages[pos / AIO_EVENTS_PER_PAGE];

But generally LGTM.

Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>