mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <llong@redhat.com>
To: Juri Lelli <juri.lelli@redhat.com>, Pingfan Liu <piliu@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Chen Ridong <chenridong@huaweicloud.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Pierre Gondois <pierre.gondois@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>
Subject: Re: [PATCHv5] sched/deadline: Walk up cpuset hierarchy to decide root domain when hot-unplug
Date: Mon, 10 Nov 2025 17:08:56 -0500	[thread overview]
Message-ID: <d42cd14d-46da-41b4-b580-f112baf0dfdb@redhat.com> (raw)
In-Reply-To: <5e0bb3f1-2efc-4302-aff0-80d5999c7700@redhat.com>

On 11/10/25 4:07 PM, Waiman Long wrote:
> On 11/10/25 6:14 AM, Juri Lelli wrote:
>> Hi,
>>
>> Looks like this has two issues.
>>
>> On 10/11/25 09:47, Pingfan Liu wrote:
>>
>> ...
>>
>>> +/*
>>> + * This function always returns a non-empty bitmap in @cpus. This 
>>> is because
>>> + * if a root domain has reserved bandwidth for DL tasks, the DL 
>>> bandwidth
>>> + * check will prevent CPU hotplug from deactivating all CPUs in 
>>> that domain.
>>> + */
>>> +static void dl_get_task_effective_cpus(struct task_struct *p, 
>>> struct cpumask *cpus)
>>> +{
>>> +    const struct cpumask *hk_msk;
>>> +
>>> +    hk_msk = housekeeping_cpumask(HK_TYPE_DOMAIN);
>>> +    if (housekeeping_enabled(HK_TYPE_DOMAIN)) {
>>> +        if (!cpumask_intersects(p->cpus_ptr, hk_msk)) {
>>> +            /*
>>> +             * CPUs isolated by isolcpu="domain" always belong to
>>> +             * def_root_domain.
>>> +             */
>>> +            cpumask_andnot(cpus, cpu_active_mask, hk_msk);
>>> +            return;
>>> +        }
>>> +    }
>>> +
>>> +    /*
>>> +     * If a root domain holds a DL task, it must have active CPUs. So
>>> +     * active CPUs can always be found by walking up the task's cpuset
>>> +     * hierarchy up to the partition root.
>>> +     */
>>> +    cpuset_cpus_allowed(p, cpus);
>> Grabs callbak_lock spin_lock (sleepable on RT) under pi_lock
>> raw_spin_lock.
> I have been thinking about changing callback_lock to a raw_spinlock_t, 
> but need to find a good use case for this change. So it is a solvable 
> problem. 

Actually, we don't need to acquire the callback_lock if cpuset_mutex is 
held. So another possibility is to create a cpuset_cpus_allowed() 
variant that doesn't acquire the callback_mutex but assert that 
cpuset_mutex is held.

Cheers,
Longman


  reply	other threads:[~2025-11-10 22:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10  1:47 Pingfan Liu
2025-11-10 11:14 ` Juri Lelli
2025-11-10 21:07   ` Waiman Long
2025-11-10 22:08     ` Waiman Long [this message]
2025-11-11 11:50       ` Pingfan Liu
2025-11-11 11:40   ` Pingfan Liu
2025-11-11 13:23     ` Juri Lelli
     [not found]       ` <da0dc9a7-ebbf-4078-8072-e75b3d7d2a5c@redhat.com>
2025-11-14 11:28         ` Pingfan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d42cd14d-46da-41b4-b580-f112baf0dfdb@redhat.com \
    --to=llong@redhat.com \
    --cc=bsegall@google.com \
    --cc=chenridong@huaweicloud.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pierre.gondois@arm.com \
    --cc=piliu@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®