lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87jzjk3hn0.fsf@mail.lhotse>
Date: Thu, 23 May 2024 21:13:55 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Eric Chanudet <echanude@...hat.com>, Dave Hansen
 <dave.hansen@...ux.intel.com>, Andy Lutomirski <luto@...nel.org>, Peter
 Zijlstra <peterz@...radead.org>, Thomas Gleixner <tglx@...utronix.de>,
 Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, "H. Peter
 Anvin" <hpa@...or.com>, Mike Rapoport <rppt@...nel.org>, Andrew Morton
 <akpm@...ux-foundation.org>, Baoquan He <bhe@...hat.com>, Nick Piggin
 <npiggin@...il.com>
Cc: x86@...nel.org, linux-arm-kernel@...ts.infradead.org,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org,
 linux-s390@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org, Eric Chanudet
 <echanude@...hat.com>
Subject: Re: [PATCH v2] mm/mm_init: use node's number of cpus in
 deferred_page_init_max_threads

Eric Chanudet <echanude@...hat.com> writes:
> x86_64 is already using the node's cpu as maximum threads. Make that the
> default for all archs setting DEFERRED_STRUCT_PAGE_INIT.
>
> This returns to the behavior prior making the function arch-specific
> with commit ecd096506922 ("mm: make deferred init's max threads
> arch-specific").
>
> Signed-off-by: Eric Chanudet <echanude@...hat.com>
>
> ---
> Setting DEFERRED_STRUCT_PAGE_INIT and testing on a few arm64 platforms
> shows faster deferred_init_memmap completions:
>
> |         | x13s        | SA8775p-ride | Ampere R137-P31 | Ampere HR330 |
> |         | Metal, 32GB | VM, 36GB     | VM, 58GB        | Metal, 128GB |
> |         | 8cpus       | 8cpus        | 8cpus           | 32cpus       |
> |---------|-------------|--------------|-----------------|--------------|
> | threads |  ms     (%) | ms       (%) |  ms         (%) |  ms      (%) |
> |---------|-------------|--------------|-----------------|--------------|
> | 1       | 108    (0%) | 72      (0%) | 224        (0%) | 324     (0%) |
> | cpus    |  24  (-77%) | 36    (-50%) |  40      (-82%) |  56   (-82%) |
>
> - v1: https://lore.kernel.org/linux-arm-kernel/20240520231555.395979-5-echanude@redhat.com
> - Changes since v1:
>  - Make the generic function return the number of cpus of the node as
>    max threads limit instead overriding it for arm64.
> - Drop Baoquan He's R-b on v1 since the logic changed.
> - Add CCs according to patch changes (ppc and s390 set
>   DEFERRED_STRUCT_PAGE_INIT by default).
>
>  arch/x86/mm/init_64.c | 12 ------------
>  mm/mm_init.c          |  2 +-
>  2 files changed, 1 insertion(+), 13 deletions(-)

On a machine here (1TB, 40 cores, 4KB pages) the existing code gives:

  [    0.500124] node 2 deferred pages initialised in 210ms
  [    0.515790] node 3 deferred pages initialised in 230ms
  [    0.516061] node 0 deferred pages initialised in 230ms
  [    0.516522] node 7 deferred pages initialised in 230ms
  [    0.516672] node 4 deferred pages initialised in 230ms
  [    0.516798] node 6 deferred pages initialised in 230ms
  [    0.517051] node 5 deferred pages initialised in 230ms
  [    0.523887] node 1 deferred pages initialised in 240ms

vs with the patch:

  [    0.379613] node 0 deferred pages initialised in 90ms
  [    0.380388] node 1 deferred pages initialised in 90ms
  [    0.380540] node 4 deferred pages initialised in 100ms
  [    0.390239] node 6 deferred pages initialised in 100ms
  [    0.390249] node 2 deferred pages initialised in 100ms
  [    0.390786] node 3 deferred pages initialised in 110ms
  [    0.396721] node 5 deferred pages initialised in 110ms
  [    0.397095] node 7 deferred pages initialised in 110ms

Which is a nice speedup.

Tested-by: Michael Ellerman <mpe@...erman.id.au> (powerpc)

cheers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ