[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9e55eb8-82a8-45f2-a949-1db182e95fc8@redhat.com>
Date: Wed, 3 Jul 2024 12:43:55 -0400
From: Waiman Long <longman@...hat.com>
To: Xavier <xavier_qy@....com>, Michal Koutný
<mkoutny@...e.com>
Cc: tj@...nel.org, akpm@...ux-foundation.org, lizefan.x@...edance.com,
hannes@...xchg.org, cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org
Subject: Re: [PATCH-cpuset v10 2/2] cpuset: use Union-Find to optimize the
merging of cpumasks
On 7/3/24 06:49, Xavier wrote:
>
> Hi Michal and Longman,
>
> Please confirm my explanation about cgroup v2 below.
>
>
> At 2024-07-03 17:40:49, "Michal Koutný" <mkoutny@...e.com> wrote:
>> On Wed, Jul 03, 2024 at 02:37:27PM GMT, Xavier <xavier_qy@....com> wrote:
>>> @@ -1102,31 +1101,25 @@ static int generate_sched_domains(cpumask_var_t **domains,
>>> if (root_load_balance && (csn == 1))
>>> goto single_root_domain;
>>>
>>> - for (i = 0; i < csn; i++)
>>> - csa[i]->pn = i;
>>> - ndoms = csn;
>>> -
>>> -restart:
>>> - /* Find the best partition (set of sched domains) */
>>> - for (i = 0; i < csn; i++) {
>>> - struct cpuset *a = csa[i];
>>> - int apn = a->pn;
>>> -
>>> - for (j = 0; j < csn; j++) {
>>> - struct cpuset *b = csa[j];
>>> - int bpn = b->pn;
>>> -
>>> - if (apn != bpn && cpusets_overlap(a, b)) {
>>> - for (k = 0; k < csn; k++) {
>>> - struct cpuset *c = csa[k];
>>> + if (!cgrpv2) {
>> I'm surprised that original code wasn't branched on this on you add it
>> here. Why is UF used only for v1 code?
>>
> In the Patch v6, I explained to Longman that based on his new patch, the overlapping check and
> merge operations for cpusets are skipped in the case of cgroup v2. Because for cgroup v2,
> doms[i] is merely copied from csa[i] rather than merged.
> This needs further confirmation from Longman.
Actually, I would like to keep the cpuset merging part for both cgroup
v1 and v2. I did notice that the hotplug code path can sometimes cause
overlapping partition roots in some intermediate states. I will try to
get it of that and use the merging part to verify that all partition
roots are mutually exclusive.
Cheers,
Longman
Powered by blists - more mailing lists