diff mbox series

[net-next] Documentation: add a description for net.core.high_order_alloc_disable

Message ID 20220706085320.17581-1-atenart@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] Documentation: add a description for net.core.high_order_alloc_disable | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: lucien.xin@gmail.com hmukos@yandex-team.ru linux-doc@vger.kernel.org corbet@lwn.net
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Antoine Tenart July 6, 2022, 8:53 a.m. UTC
A description is missing for the net.core.high_order_alloc_disable
option in admin-guide/sysctl/net.rst ; add it. The above sysctl option
was introduced by commit ce27ec60648d ("net: add high_order_alloc_disable
sysctl/static key").

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
---
 Documentation/admin-guide/sysctl/net.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Eric Dumazet July 6, 2022, 1:24 p.m. UTC | #1
On Wed, Jul 6, 2022 at 10:53 AM Antoine Tenart <atenart@kernel.org> wrote:
>
> A description is missing for the net.core.high_order_alloc_disable
> option in admin-guide/sysctl/net.rst ; add it. The above sysctl option
> was introduced by commit ce27ec60648d ("net: add high_order_alloc_disable
> sysctl/static key").
>
> Cc: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Antoine Tenart <atenart@kernel.org>
> ---
>  Documentation/admin-guide/sysctl/net.rst | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/Documentation/admin-guide/sysctl/net.rst b/Documentation/admin-guide/sysctl/net.rst
> index fcd650bdbc7e..85ab83411359 100644
> --- a/Documentation/admin-guide/sysctl/net.rst
> +++ b/Documentation/admin-guide/sysctl/net.rst
> @@ -391,6 +391,16 @@ GRO has decided not to coalesce, it is placed on a per-NAPI list. This
>  list is then passed to the stack when the number of segments reaches the
>  gro_normal_batch limit.
>
> +high_order_alloc_disable
> +------------------------
> +
> +By default the allocator for page frags tries to use high order pages (order-3
> +on x86). While the default behavior gives good results in most cases, some users
> +might hit a contention in page allocations/freeing. This allows to opt-in for
> +order-0 allocation instead.
>

Note:

linux-5.14 allowed high-order pages to be stored on the per-cpu lists.

I ran again the benchmark cited in commit ce27ec60648d to confirm that
the slowdown we had before 5.14 for
high number of alloc/frees per second is no more.

    for thr in {1..30}
    do
     sysctl -wq net.core.high_order_alloc_disable=0
     T0=`./super_netperf $thr -H 127.0.0.1 -l 15`
     sysctl -wq net.core.high_order_alloc_disable=1
     T1=`./super_netperf $thr -H 127.0.0.1 -l 15`
     echo $thr:$T0:$T1
    done

1:62799:48115
2:121604:94588
3:183240:138376
4:241544:184639
5:302641:232985
6:358566:276494
7:418464:316401
8:470687:362562
9:528084:401193
10:586269:446422
11:642764:482556
12:696490:530701
13:748840:573388
14:808681:610787
15:856676:645813
16:912061:687695
17:966847:738943
18:1011960:771893
19:1056554:798815
20:1109519:844586
21:1159857:849445
22:1203224:888646
23:1226389:933538
24:1238174:964386
...


 +
> +Default: 0
> +
>  2. /proc/sys/net/unix - Parameters for Unix domain sockets
>  ----------------------------------------------------------
>
> --
> 2.36.1
>
Jakub Kicinski July 6, 2022, 9:18 p.m. UTC | #2
On Wed, 6 Jul 2022 15:24:58 +0200 Eric Dumazet wrote:
> linux-5.14 allowed high-order pages to be stored on the per-cpu lists.
> 
> I ran again the benchmark cited in commit ce27ec60648d to confirm that
> the slowdown we had before 5.14 for
> high number of alloc/frees per second is no more.

Sounds useful to know - Antoine, do you reckon we can include a mention
of this knob being mostly of historical importance?
Antoine Tenart July 7, 2022, 7:23 a.m. UTC | #3
Quoting Jakub Kicinski (2022-07-06 23:18:39)
> On Wed, 6 Jul 2022 15:24:58 +0200 Eric Dumazet wrote:
> > linux-5.14 allowed high-order pages to be stored on the per-cpu lists.
> > 
> > I ran again the benchmark cited in commit ce27ec60648d to confirm that
> > the slowdown we had before 5.14 for
> > high number of alloc/frees per second is no more.
> 
> Sounds useful to know - Antoine, do you reckon we can include a mention
> of this knob being mostly of historical importance?

Sure, I'll send a v2 with that.

Thanks!
Antoine
diff mbox series

Patch

diff --git a/Documentation/admin-guide/sysctl/net.rst b/Documentation/admin-guide/sysctl/net.rst
index fcd650bdbc7e..85ab83411359 100644
--- a/Documentation/admin-guide/sysctl/net.rst
+++ b/Documentation/admin-guide/sysctl/net.rst
@@ -391,6 +391,16 @@  GRO has decided not to coalesce, it is placed on a per-NAPI list. This
 list is then passed to the stack when the number of segments reaches the
 gro_normal_batch limit.
 
+high_order_alloc_disable
+------------------------
+
+By default the allocator for page frags tries to use high order pages (order-3
+on x86). While the default behavior gives good results in most cases, some users
+might hit a contention in page allocations/freeing. This allows to opt-in for
+order-0 allocation instead.
+
+Default: 0
+
 2. /proc/sys/net/unix - Parameters for Unix domain sockets
 ----------------------------------------------------------