[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgT0UeMbASOkxNpa68PXDALW5oT5PqPHTXKMKc1TKxFVVPkjA@mail.gmail.com>
Date: Fri, 18 Oct 2024 09:43:39 -0700
From: Alexander Duyck <alexander.duyck@...il.com>
To: Yunsheng Lin <linyunsheng@...wei.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org
Subject: Re: [PATCH net-next v22 06/14] mm: page_frag: reuse existing space
for 'size' and 'pfmemalloc'
On Fri, Oct 18, 2024 at 4:00 AM Yunsheng Lin <linyunsheng@...wei.com> wrote:
>
> Currently there is one 'struct page_frag' for every 'struct
> sock' and 'struct task_struct', we are about to replace the
> 'struct page_frag' with 'struct page_frag_cache' for them.
> Before begin the replacing, we need to ensure the size of
> 'struct page_frag_cache' is not bigger than the size of
> 'struct page_frag', as there may be tens of thousands of
> 'struct sock' and 'struct task_struct' instances in the
> system.
>
> By or'ing the page order & pfmemalloc with lower bits of
> 'va' instead of using 'u16' or 'u32' for page size and 'u8'
> for pfmemalloc, we are able to avoid 3 or 5 bytes space waste.
> And page address & pfmemalloc & order is unchanged for the
> same page in the same 'page_frag_cache' instance, it makes
> sense to fit them together.
>
> After this patch, the size of 'struct page_frag_cache' should be
> the same as the size of 'struct page_frag'.
>
> CC: Alexander Duyck <alexander.duyck@...il.com>
> Signed-off-by: Yunsheng Lin <linyunsheng@...wei.com>
> ---
> include/linux/mm_types_task.h | 19 +++++----
> include/linux/page_frag_cache.h | 24 ++++++++++-
> mm/page_frag_cache.c | 70 ++++++++++++++++++++++-----------
> 3 files changed, 81 insertions(+), 32 deletions(-)
>
LGTM
Reviewed-by: Alexander Duyck <alexanderduyck@...com>
Powered by blists - more mailing lists