linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Arnd Bergmann" <arnd@kernel.org>
Cc: "Dennis Zhou" <dennis@kernel.org>, "Tejun Heo" <tj@kernel.org>,
	"Christoph Lameter" <cl@linux.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Will Deacon" <will@kernel.org>,
	"kernel test robot" <lkp@intel.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Kent Overstreet" <kent.overstreet@linux.dev>,
	"Hou Tao" <houtao1@huawei.com>, "Jan Kara" <jack@suse.cz>,
	"Jianhui Zhou" <912460177@qq.com>,
	"Yury Norov" <yury.norov@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] preempt_rt: increase PERCPU_DYNAMIC_SIZE_SHIFT for slab randomization
Date: Mon, 07 Oct 2024 10:59:36 +0000	[thread overview]
Message-ID: <98957f9e-aa9b-4d8c-8254-968905e85023@app.fastmail.com> (raw)
In-Reply-To: <20241007104348.ImJPXDl9@linutronix.de>

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@arndb.de>
Reported-by: Arnd Bergmann <arnd@arndb.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


  reply	other threads:[~2024-10-07 11:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04  9:56 Arnd Bergmann
2024-10-07 10:43 ` Sebastian Andrzej Siewior
2024-10-07 10:59   ` Arnd Bergmann [this message]
2024-10-07 12:22     ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98957f9e-aa9b-4d8c-8254-968905e85023@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=912460177@qq.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=cl@linux.com \
    --cc=dennis@kernel.org \
    --cc=houtao1@huawei.com \
    --cc=jack@suse.cz \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=surenb@google.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=will@kernel.org \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox