[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iKYgt-61ku46p3D1yHtc7RUVqeB5WN83Tfd+ZtyeE+Mug@mail.gmail.com>
Date: Tue, 17 Dec 2024 12:09:00 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Yajun Deng <yajun.deng@...ux.dev>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] sock: make SKB_FRAG_PAGE_ORDER equal to PAGE_ALLOC_COSTLY_ORDER
On Tue, Dec 17, 2024 at 11:56 AM Yajun Deng <yajun.deng@...ux.dev> wrote:
>
> The SKB_FRAG_PAGE_ORDER will be 3 if PAGE_SIZE is 4096, and less than 3
> if it is not. So it will increase the number of memory allocations if
> PAGE_SIZE is greater than 4096.
>
> alloc_pages() only relates to the order, if an order is less than or equal
> to PAGE_ALLOC_COSTLY_ORDER, it will get the page from rmqueue_pcplist() in
> rmqueue(). So there's no need for the order to be less than
> PAGE_ALLOC_COSTLY_ORDER.
>
> To decrease the number of memory allocations, make SKB_FRAG_PAGE_ORDER
> equal to PAGE_ALLOC_COSTLY_ORDER even if PAGE_SIZE isn't 4096.
>
> Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>
> ---
> include/net/sock.h | 2 +-
> net/core/sock.c | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 7464e9f9f47c..a33645226577 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -2853,7 +2853,7 @@ extern __u32 sysctl_rmem_max;
> extern __u32 sysctl_wmem_default;
> extern __u32 sysctl_rmem_default;
>
> -#define SKB_FRAG_PAGE_ORDER get_order(32768)
We do not want to allow some programs to work on arches with 64K page
sizes, and not work on 4K page sizes.
Please post your precise use case.
Powered by blists - more mailing lists