Re: [PATCH v5 10/24] tick/nohz: Move tick_nohz_full_mask declaration outside the #ifdef

From: James Morse
Date: Fri Sep 08 2023 - 11:58:48 EST


Hi Reinette,

On 8/25/23 01:43, Reinette Chatre wrote:
On 8/24/2023 9:55 AM, James Morse wrote:
On 09/08/2023 23:34, Reinette Chatre wrote:
On 7/28/2023 9:42 AM, James Morse wrote:
tick_nohz_full_mask lists the CPUs that are nohz_full. This is only
needed when CONFIG_NO_HZ_FULL is defined. tick_nohz_full_cpu() allows
a specific CPU to be tested against the mask, and evaluates to false
when CONFIG_NO_HZ_FULL is not defined.

The resctrl code needs to pick a CPU to run some work on, a new helper
prefers housekeeping CPUs by examining the tick_nohz_full_mask. Hiding
the declaration behind #ifdef CONFIG_NO_HZ_FULL forces all the users to
be behind an ifdef too.

Move the tick_nohz_full_mask declaration, this lets callers drop the
ifdef, and guard access to tick_nohz_full_mask with IS_ENABLED() or
something like tick_nohz_full_cpu().

The definition does not need to be moved as any callers should be
removed at compile time unless CONFIG_NO_HZ_FULL is defined.

This is outside of the resctrl area. What is the upstreaming
plan for this patch?

Once you're happy with the rest of it - we can give the other folk on CC a poke.
I'd assume changes to this file also go via tip. It would just need an ack from the
relevant person.

At the moment this change is buried within a pile of resctrl
changes so we need to make sure that folks are not surprised by this
thinking we are trying to sneak it in. Please note that
CC is currently missing Frederic Weisbecker.

Oops, fixed.


I wonder if it may help to change cover letter to be something like
"x86/resctrl and tick/nohz: Monitor ..." Just an idea.

I think that would be excessive - the subject of the patch already matches what is normal for that file. I'll move the patch to the top of the series as that makes it clearer that there is no dependency on the rest of the series.


Thanks,

James