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]
Message-ID: <32bd769c-b692-8896-5cc9-d19ab0a23abb@oracle.com>
Date:   Fri, 28 Jun 2019 18:16:28 -0700
From:   Subhra Mazumdar <subhra.mazumdar@...cle.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>, tkjos@...gle.com,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        quentin.perret@...aro.org, chris.redpath@....com,
        steven.sistare@...cle.com, songliubraving@...com
Subject: Re: [PATCH V3 2/2] sched/fair: Fallback to sched-idle CPU if idle CPU
 isn't found


On 6/25/19 10:06 PM, Viresh Kumar wrote:
> We try to find an idle CPU to run the next task, but in case we don't
> find an idle CPU it is better to pick a CPU which will run the task the
> soonest, for performance reason.
>
> A CPU which isn't idle but has only SCHED_IDLE activity queued on it
> should be a good target based on this criteria as any normal fair task
> will most likely preempt the currently running SCHED_IDLE task
> immediately. In fact, choosing a SCHED_IDLE CPU over a fully idle one
> shall give better results as it should be able to run the task sooner
> than an idle CPU (which requires to be woken up from an idle state).
>
> This patch updates both fast and slow paths with this optimization.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
>   kernel/sched/fair.c | 43 +++++++++++++++++++++++++++++++++----------
>   1 file changed, 33 insertions(+), 10 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 1277adc3e7ed..2e0527fd468c 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5376,6 +5376,15 @@ static struct {
>   
>   #endif /* CONFIG_NO_HZ_COMMON */
>   
> +/* CPU only has SCHED_IDLE tasks enqueued */
> +static int sched_idle_cpu(int cpu)
> +{
> +	struct rq *rq = cpu_rq(cpu);
> +
> +	return unlikely(rq->nr_running == rq->cfs.idle_h_nr_running &&
> +			rq->nr_running);
> +}
> +
Shouldn't this check if rq->curr is also sched idle? And why not drop the
rq->nr_running non zero check?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ