Re: [PATCH 1/7] mm: allocate mm_cpumask dynamically based on nr_cpu_ids

From: Rik van Riel
Date: Fri Jun 22 2018 - 13:46:01 EST


On Fri, 2018-06-22 at 08:10 -0700, Dave Hansen wrote:
> On 06/20/2018 12:56 PM, Rik van Riel wrote:
> > /*
> > - * FIXME! The "sizeof(struct mm_struct)" currently
> > includes the
> > - * whole struct cpumask for the OFFSTACK case. We could
> > change
> > - * this to *only* allocate as much of it as required by
> > the
> > - * maximum number of CPU's we can ever have. The
> > cpumask_allocation
> > - * is at the end of the structure, exactly for that
> > reason.
> > + * The mm_cpumask is located at the end of mm_struct, and
> > is
> > + * dynamically sized based on nr_cpu_ids.
> > */
> > + mm_size = sizeof(struct mm_struct) + cpumask_size();
> > +
> > mm_cachep = kmem_cache_create_usercopy("mm_struct",
> > - sizeof(struct mm_struct),
> > ARCH_MIN_MMSTRUCT_ALIGN,
> > + mm_size, ARCH_MIN_MMSTRUCT_ALIGN,
>
> Could you add a bit to that comment, like "dynamically sized based on
> nr_cpu_ids" ... which is sized based on the number of possible CPUs.
>
> I found myself wondering how that interacts with hotplug.

Improved in my tree for v2. Thank you.

--
All Rights Reversed.

Attachment: signature.asc
Description: This is a digitally signed message part