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, 14 Sep 2016 17:53:45 +0200
From:   Oleg Nesterov <oleg@...hat.com>
To:     Cheng Chao <cs.os.kernel@...il.com>
Cc:     mingo@...nel.org, peterz@...radead.org, tj@...nel.org,
        akpm@...ux-foundation.org, chris@...is-wilson.co.uk,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] stop_machine: Avoid a sleep and wakeup in the
        stop_one_cpu()

On 09/14, Cheng Chao wrote:
>
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1063,8 +1063,12 @@ static int migration_cpu_stop(void *data)
>  	 * holding rq->lock, if p->on_rq == 0 it cannot get enqueued because
>  	 * we're holding p->pi_lock.
>  	 */
> -	if (task_rq(p) == rq && task_on_rq_queued(p))
> -		rq = __migrate_task(rq, p, arg->dest_cpu);
> +	if (task_rq(p) == rq) {
> +		if (task_on_rq_queued(p))
> +			rq = __migrate_task(rq, p, arg->dest_cpu);
> +		else
> +			p->wake_cpu = arg->dest_cpu;
> +	}

Cough ;) again, I leave this to Peter...

But imo this change should be documented or perhaps even separated.
It looks fine to me, but this has nothing to do with "we can avoid
a sleep+wakeup by doing a preemption" from the changelog.

This is another improvement, and a small note in the changelog can
unconfuse the reader of git blame/log.

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ