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  linux-cve-announce  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:   Wed, 8 Apr 2020 15:30:32 +0200
From:   luca abeni <luca.abeni@...tannapisa.it>
To:     Valentin Schneider <valentin.schneider@....com>
Cc:     Dietmar Eggemann <dietmar.eggemann@....com>,
        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>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Wei Wang <wvw@...gle.com>, Quentin Perret <qperret@...gle.com>,
        Alessio Balsini <balsini@...gle.com>,
        Pavan Kondeti <pkondeti@...eaurora.org>,
        Patrick Bellasi <patrick.bellasi@...bug.net>,
        Morten Rasmussen <morten.rasmussen@....com>,
        Qais Yousef <qais.yousef@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] sched/deadline: Improve admission control for
 asymmetric CPU capacities

Hi Valentin,

On Wed, 08 Apr 2020 11:42:14 +0100
Valentin Schneider <valentin.schneider@....com> wrote:

> On 08/04/20 10:50, Dietmar Eggemann wrote:
> > +++ b/kernel/sched/sched.h
> > @@ -304,11 +304,14 @@ void __dl_add(struct dl_bw *dl_b, u64 tsk_bw,
> > int cpus) __dl_update(dl_b, -((s32)tsk_bw / cpus));
> >  }
> >
> > +static inline unsigned long rd_capacity(int cpu);
> > +
> >  static inline
> > -bool __dl_overflow(struct dl_bw *dl_b, int cpus, u64 old_bw, u64
> > new_bw) +bool __dl_overflow(struct dl_bw *dl_b, int cpu, u64
> > old_bw, u64 new_bw) {
> >       return dl_b->bw != -1 &&
> > -	       dl_b->bw * cpus < dl_b->total_bw - old_bw + new_bw;
> > +	       cap_scale(dl_b->bw, rd_capacity(cpu)) <
> > +	       dl_b->total_bw - old_bw + new_bw;
> >  }
> >  
> 
> I don't think this is strictly equivalent to what we have now for the
> SMP case. 'cpus' used to come from dl_bw_cpus(), which is an ugly way
> of writing
> 
>      cpumask_weight(rd->span AND cpu_active_mask);
> 
> The rd->cpu_capacity_orig field you added gets set once per domain
> rebuild, so it also happens in sched_cpu_(de)activate() but is
> separate from touching cpu_active_mask. AFAICT this mean we can
> observe a CPU as !active but still see its capacity_orig accounted in
> a root_domain.

Sorry, I suspect this is my fault, because the bug comes from my
original patch.
When I wrote the original code, I believed that when a CPU is
deactivated it is also removed from its root domain.

I now see that I was wrong.


			Luca

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ