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: <98957f9e-aa9b-4d8c-8254-968905e85023@app.fastmail.com>
Date: Mon, 07 Oct 2024 10:59:36 +0000
From: "Arnd Bergmann" <arnd@...db.de>
To: "Sebastian Andrzej Siewior" <bigeasy@...utronix.de>,
 "Arnd Bergmann" <arnd@...nel.org>
Cc: "Dennis Zhou" <dennis@...nel.org>, "Tejun Heo" <tj@...nel.org>,
 "Christoph Lameter" <cl@...ux.com>, "Thomas Gleixner" <tglx@...utronix.de>,
 "Will Deacon" <will@...nel.org>, "kernel test robot" <lkp@...el.com>,
 "Andrew Morton" <akpm@...ux-foundation.org>,
 "Suren Baghdasaryan" <surenb@...gle.com>,
 "Kent Overstreet" <kent.overstreet@...ux.dev>,
 "Hou Tao" <houtao1@...wei.com>, "Jan Kara" <jack@...e.cz>,
 "Jianhui Zhou" <912460177@...com>, "Yury Norov" <yury.norov@...il.com>,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] preempt_rt: increase PERCPU_DYNAMIC_SIZE_SHIFT for slab
 randomization

On Mon, Oct 7, 2024, at 10:43, Sebastian Andrzej Siewior wrote:
> On 2024-10-04 09:56:56 [+0000], Arnd Bergmann wrote:
> How bad is it, to have PERCPU_DYNAMIC_SIZE_SHIFT unconditionally set to
> 13? If it is bad could we restrict it with LOCKDEP and PAGE_SIZE > 4KiB?
>
> So maybe something like this:
>
> diff --git a/include/linux/percpu.h b/include/linux/percpu.h
> index b6321fc491598..52b5ea663b9f0 100644
> --- a/include/linux/percpu.h
> +++ b/include/linux/percpu.h
> @@ -41,7 +41,11 @@
>  					 PCPU_MIN_ALLOC_SHIFT)
> 
>  #ifdef CONFIG_RANDOM_KMALLOC_CACHES
> -#define PERCPU_DYNAMIC_SIZE_SHIFT      12
> +# if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PAGE_SIZE_4KB)
> +# define PERCPU_DYNAMIC_SIZE_SHIFT      13
> +# else
> +# define PERCPU_DYNAMIC_SIZE_SHIFT      12
> +#endif /* LOCKDEP and PAGE_SIZE > 4KiB */
>  #else
>  #define PERCPU_DYNAMIC_SIZE_SHIFT      10
>  #endif

I think that's fine. If you have lockdep and large page sizes,
the percpu memory area is entirely lost in the noise of the
overhead you already get.

For your version:

Acked-by: Arnd Bergmann <arnd@...db.de>
Reported-by: Arnd Bergmann <arnd@...db.de>

Can you pick that up for rt fixes (if you already have a tree)
or send it to Andrew for the mm tree? Feel free to take my
changelog text.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ