arch/x86/kernel/cpu/resctrl/internal.h | 28 +++------- include/linux/cpumask.h | 75 ++++++++++++++++++++++++-- include/linux/find.h | 25 +++++++++ lib/find_bit.c | 11 ++++ 4 files changed, 114 insertions(+), 25 deletions(-)
From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
cpumask library missed some flavors of cpumask_any_but(), which makes
users to workaround it by using less efficient cpumask_nth() functions
This series adds missing cpumask_any_andnot_but() and makes
cpumask_any_but() understanding the RESCTRL_PICK_ANY_CPU hint.
This simplifies cpumask_any_housekeeping() significantly.
v1: https://lore.kernel.org/all/20250407153856.133093-1-yury.norov@gmail.com/
v2:
- switch cpumask_any_but() functions to signed type for CPU (Reinette);
- change name for the new function to cpumask_any_andnot_but() (James);
- drop O(n*log(n)) comment. cpumask_nth() is slower, but still linear.
Yury Norov [NVIDIA] (4):
cpumask: relax cpumask_any_but()
find: add find_first_andnot_bit()
cpumask: add cpumask_{first,next}_andnot() API
x86/resctrl: optimize cpumask_any_housekeeping()
arch/x86/kernel/cpu/resctrl/internal.h | 28 +++-------
include/linux/cpumask.h | 75 ++++++++++++++++++++++++--
include/linux/find.h | 25 +++++++++
lib/find_bit.c | 11 ++++
4 files changed, 114 insertions(+), 25 deletions(-)
--
2.43.0
Hi Yury,
On 4/27/25 11:52 AM, Yury Norov wrote:
> From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
>
> cpumask library missed some flavors of cpumask_any_but(), which makes
> users to workaround it by using less efficient cpumask_nth() functions
>
> This series adds missing cpumask_any_andnot_but() and makes
> cpumask_any_but() understanding the RESCTRL_PICK_ANY_CPU hint.
> This simplifies cpumask_any_housekeeping() significantly.
>
> v1: https://lore.kernel.org/all/20250407153856.133093-1-yury.norov@gmail.com/
> v2:
> - switch cpumask_any_but() functions to signed type for CPU (Reinette);
> - change name for the new function to cpumask_any_andnot_but() (James);
> - drop O(n*log(n)) comment. cpumask_nth() is slower, but still linear.
>
> Yury Norov [NVIDIA] (4):
> cpumask: relax cpumask_any_but()
> find: add find_first_andnot_bit()
> cpumask: add cpumask_{first,next}_andnot() API
> x86/resctrl: optimize cpumask_any_housekeeping()
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Does anything in your "bitmap-for-next" branch depend on this
series? If not, would you be ok if this series goes upstream
via tip (pending confirmation from tip maintainers) to make
for smoother upstream of resctrl patches that touch the same area?
Thank you very much for doing this work.
Reinette
On Thu, May 01, 2025 at 03:06:18PM -0700, Reinette Chatre wrote:
> Hi Yury,
>
> On 4/27/25 11:52 AM, Yury Norov wrote:
> > From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
> >
> > cpumask library missed some flavors of cpumask_any_but(), which makes
> > users to workaround it by using less efficient cpumask_nth() functions
> >
> > This series adds missing cpumask_any_andnot_but() and makes
> > cpumask_any_but() understanding the RESCTRL_PICK_ANY_CPU hint.
> > This simplifies cpumask_any_housekeeping() significantly.
> >
> > v1: https://lore.kernel.org/all/20250407153856.133093-1-yury.norov@gmail.com/
> > v2:
> > - switch cpumask_any_but() functions to signed type for CPU (Reinette);
> > - change name for the new function to cpumask_any_andnot_but() (James);
> > - drop O(n*log(n)) comment. cpumask_nth() is slower, but still linear.
> >
> > Yury Norov [NVIDIA] (4):
> > cpumask: relax cpumask_any_but()
> > find: add find_first_andnot_bit()
> > cpumask: add cpumask_{first,next}_andnot() API
> > x86/resctrl: optimize cpumask_any_housekeeping()
>
> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
>
> Does anything in your "bitmap-for-next" branch depend on this
> series? If not, would you be ok if this series goes upstream
> via tip (pending confirmation from tip maintainers) to make
> for smoother upstream of resctrl patches that touch the same area?
Sure, please take it with the resctrl material.
> Thank you very much for doing this work.
Thanks for warm words. :)
Dear x86 Maintainers,
On 5/2/25 8:32 AM, Yury Norov wrote:
> On Thu, May 01, 2025 at 03:06:18PM -0700, Reinette Chatre wrote:
>> Hi Yury,
>>
>> On 4/27/25 11:52 AM, Yury Norov wrote:
>>> From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
>>>
>>> cpumask library missed some flavors of cpumask_any_but(), which makes
>>> users to workaround it by using less efficient cpumask_nth() functions
>>>
>>> This series adds missing cpumask_any_andnot_but() and makes
>>> cpumask_any_but() understanding the RESCTRL_PICK_ANY_CPU hint.
>>> This simplifies cpumask_any_housekeeping() significantly.
>>>
>>> v1: https://lore.kernel.org/all/20250407153856.133093-1-yury.norov@gmail.com/
>>> v2:
>>> - switch cpumask_any_but() functions to signed type for CPU (Reinette);
>>> - change name for the new function to cpumask_any_andnot_but() (James);
>>> - drop O(n*log(n)) comment. cpumask_nth() is slower, but still linear.
>>>
>>> Yury Norov [NVIDIA] (4):
>>> cpumask: relax cpumask_any_but()
>>> find: add find_first_andnot_bit()
>>> cpumask: add cpumask_{first,next}_andnot() API
>>> x86/resctrl: optimize cpumask_any_housekeeping()
>>
>> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
>>
>> Does anything in your "bitmap-for-next" branch depend on this
>> series? If not, would you be ok if this series goes upstream
>> via tip (pending confirmation from tip maintainers) to make
>> for smoother upstream of resctrl patches that touch the same area?
>
> Sure, please take it with the resctrl material.
>
Could you please consider this work for inclusion into tip's
x86/cache branch?
Thank you very much.
Reinette
© 2016 - 2025 Red Hat, Inc.