[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a6f58c5-40f3-4c89-8988-a9fee932e3ca@rasmusvillemoes.dk>
Date: Wed, 20 Mar 2024 10:03:02 +0100
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Dawei Li <dawei.li@...ngroup.cn>, yury.norov@...il.com,
andriy.shevchenko@...ux.intel.com, akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpumask: Create dedicated kmem cache for cpumask var
On 19/03/2024 13.24, Dawei Li wrote:
> alloc_cpumask_var_node() and friends allocate cpumask var dynamically
> for CONFIG_CPUMASK_OFFSTACK=y kernel. The allocated size of cpumask var
> is cpumask_size(), which is runtime constant after nr_cpu_ids is
> freezed.
>
> Create a dedicated kmem cache for dynamic allocation of cpumask var.
Why?
> The window for creation of cache is somewhat narrow:
> - After last update of nr_cpu_ids(via set_nr_cpu_ids())
> - After kmem cache is available.
> - Before any alloc_cpumask_var_node() invocations(sched_init() e.g).
OK, so this sounds somewhat fragile. It's maybe correct, but I fail to
see what is gained by this, and the commit message does not provide any
hints.
Rasmus
Powered by blists - more mailing lists