lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 1 May 2020 18:12:05 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Pavan Kondeti <pkondeti@...eaurora.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Luca Abeni <luca.abeni@...tannapisa.it>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Wei Wang <wvw@...gle.com>, Quentin Perret <qperret@...gle.com>,
        Alessio Balsini <balsini@...gle.com>,
        Patrick Bellasi <patrick.bellasi@...bug.net>,
        Morten Rasmussen <morten.rasmussen@....com>,
        Valentin Schneider <valentin.schneider@....com>,
        Qais Yousef <qais.yousef@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/6] sched/deadline: Optimize dl_bw_cpus()

On 30/04/2020 12:55, Pavan Kondeti wrote:
> On Mon, Apr 27, 2020 at 10:37:05AM +0200, Dietmar Eggemann wrote:

[..]

>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>> index 504d2f51b0d6..4ae22bfc37ae 100644
>> --- a/kernel/sched/deadline.c
>> +++ b/kernel/sched/deadline.c
>> @@ -54,10 +54,16 @@ static inline struct dl_bw *dl_bw_of(int i)
>>  static inline int dl_bw_cpus(int i)
>>  {
>>  	struct root_domain *rd = cpu_rq(i)->rd;
>> -	int cpus = 0;
>> +	int cpus;
>>  
>>  	RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held(),
>>  			 "sched RCU must be held");
>> +
>> +	if (cpumask_subset(rd->span, cpu_active_mask))
>> +		return cpumask_weight(rd->span);
>> +
> 
> Looks good to me. This is a nice optimization.
> 
>> +	cpus = 0;
>> +
>>  	for_each_cpu_and(i, rd->span, cpu_active_mask)
>>  		cpus++;
>>  
> Do you know why this check is in place? Is it only to cover
> the case of cpuset_cpu_inactive()->dl_cpu_busy()?

It should cover:

(1) Preventing CPU hp when DL detects a possible overflow w/o the CPU:

    sched_cpu_deactivate() -> cpuset_cpu_inactive() -> dl_cpu_busy() ->
    dl_bw_cpus() [now replaced by dl_bw_capacity()].

(2) DL Admission Control in CPU HP:

    __sched_setscheduler() -> sched_dl_overflow() -> dl_bw_cpus()
                                           [now + -> dl_bw_capacity()]

(3) In create/destroy exclusive cpusets scenarios (comment in
    set_cpus_allowed_dl(), although I wasn't able to provoke this so
    far:

    do_set_cpus_allowed() -> p->sched_class->set_cpus_allowed() was
    never called when I ran a DL testcase and create/destroy exclusive
    cpusets at the same time?

Powered by blists - more mailing lists