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
| ||
|
Message-ID: <20180425051509.aohopadqw7q5urbd@vireshk-i7> Date: Wed, 25 Apr 2018 10:45:09 +0530 From: Viresh Kumar <viresh.kumar@...aro.org> To: Peter Zijlstra <peterz@...radead.org> Cc: Valentin Schneider <valentin.schneider@....com>, Ingo Molnar <mingo@...hat.com>, Vincent Guittot <vincent.guittot@...aro.org>, Daniel Lezcano <daniel.lezcano@...aro.org>, linux-kernel@...r.kernel.org, Quentin Perret <quentin.perret@....com>, c@...ez.programming.kicks-ass.net Subject: Re: [PATCH] sched/fair: Rearrange select_task_rq_fair() to optimize it On 24-04-18, 14:35, Peter Zijlstra wrote: > In any case, if there not going to be conflicts here, this all looks > good. Thanks Peter. I also had another patch and wasn't sure if that would be the right thing to do. The main purpose of this is to avoid calling sync_entity_load_avg() unnecessarily. +++ b/kernel/sched/fair.c @@ -6196,9 +6196,6 @@ static inline int find_idlest_cpu(struct sched_domain *sd, struct task_struct *p { int new_cpu = cpu; - if (!cpumask_intersects(sched_domain_span(sd), &p->cpus_allowed)) - return prev_cpu; - while (sd) { struct sched_group *group; struct sched_domain *tmp; @@ -6652,15 +6649,19 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f if (unlikely(sd)) { /* Slow path */ - /* - * We're going to need the task's util for capacity_spare_wake - * in find_idlest_group. Sync it up to prev_cpu's - * last_update_time. - */ - if (!(sd_flag & SD_BALANCE_FORK)) - sync_entity_load_avg(&p->se); + if (!cpumask_intersects(sched_domain_span(sd), &p->cpus_allowed)) { + new_cpu = prev_cpu; + } else { + /* + * We're going to need the task's util for + * capacity_spare_wake in find_idlest_group. Sync it up + * to prev_cpu's last_update_time. + */ + if (!(sd_flag & SD_BALANCE_FORK)) + sync_entity_load_avg(&p->se); - new_cpu = find_idlest_cpu(sd, p, cpu, prev_cpu, sd_flag); + new_cpu = find_idlest_cpu(sd, p, cpu, prev_cpu, sd_flag); + } } else if (sd_flag & SD_BALANCE_WAKE) { /* XXX always ? */ /* Fast path */ -- viresh
Powered by blists - more mailing lists