Re: [PATCH 02/13] kernel/cpu: Add support for declaring CPU hotplug not supported

From: Kirill A. Shutemov
Date: Wed Oct 11 2023 - 09:07:59 EST


On Tue, Oct 10, 2023 at 06:35:59AM -0700, Kuppuswamy Sathyanarayanan wrote:
>
>
> On 10/5/2023 6:13 AM, Kirill A. Shutemov wrote:
> > The function cpu_hotplug_not_supported() can be called to indicate that
> > CPU hotplug should be disabled. It does not prevent the initial bring up
> > of the CPU, but it stops subsequent offlining.
> >
> > This function is intended to replace CC_ATTR_HOTPLUG_DISABLED.
> >
>
> Looks good to me.
>
> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>

Thanks.

> > @@ -543,6 +546,18 @@ static void lockdep_release_cpus_lock(void)
> > rwsem_release(&cpu_hotplug_lock.dep_map, _THIS_IP_);
> > }
> >
> > +/*
> > + * Declare CPU hotplug not supported.
> > + *
> > + * It doesn't prevent initial bring up of the CPU, but stops offlining.
> > + */
> > +void cpu_hotplug_not_supported(void)
> > +{
> > + cpu_maps_update_begin();
> > + cpu_hotplug_supported = false;
> > + cpu_maps_update_done();
> > +}
>
> Since this function is not used in this patch, do you need to add __maybe_unused to
> avoid warnings?

Hm? I don't think compiler complains about non-static unused functions. It
has no visibility if it is used.

--
Kiryl Shutsemau / Kirill A. Shutemov