Re: [PATCH 1/2] sched/isolation: Exclude dynamically isolated CPUs from housekeeping masks

From: Waiman Long
Date: Thu Mar 28 2024 - 20:56:33 EST



On 3/25/24 19:21, Frederic Weisbecker wrote:
Le Wed, Feb 28, 2024 at 09:14:13PM -0500, Waiman Long a écrit :
The housekeeping CPU masks, set up by the "isolcpus" and "nohz_full"
boot command line options, are used at boot time to exclude selected CPUs
from running some kernel background processes to minimize disturbance
to latency sensitive userspace applications. Some of housekeeping CPU
masks are also checked at run time to avoid using those isolated CPUs.

The cpuset subsystem is now able to dynamically create a set of isolated
CPUs to be used in isolated cpuset partitions. The long term goal is
to make the degree of isolation as close as possible to what can be
done statically using those boot command line options.

This patch is a step in that direction by making the housekeeping CPU
mask APIs exclude the dynamically isolated CPUs when they are called
at run time. The housekeeping CPU masks will fall back to the bootup
default when all the dynamically isolated CPUs are released.

A new housekeeping_exlude_isolcpus() function is added which is to be
called by the cpuset subsystem to provide a list of isolated CPUs to
be excluded.
Can we instead overwrite housekeeping_boot.cpumasks from cpusets entirely and
forget about the original boot value forever?

That is an interesting question.

I think we will still need to keep the boot values somewhere, at least until we can dynamically isolate CPUs as good as what can be done at boot time. At this point, what can be done dynamically is still limited. So we want to keep the statically isolated CPUs around without breaking its isolation. Of course, we can do all these within cpuset with minimal change in kernel/sched/isolation.c.

Cheers,
Longman