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-next>] [day] [month] [year] [list]
Message-ID: <20160701030801.GA15593@root>
Date:	Fri, 1 Jul 2016 11:08:01 +0800
From:	"T.Zhou" <t1zhou@....com>
To:	peterz@...radead.org
Cc:	mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: [PATCH] sched: Assign !p->on_cpu to the second parameter of
 smp_cond_load_acquire()

The second parameter of smp_cond_load_acquire() should be !p->on_cpu
cause remote wakeup need to ensure that: if the task is running on
prev cpu, it should be descheduled before doing the actual wakeup.

Signed-off-by: T.Zhou <t1zhou@....com>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3387e4f..8e6fef6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2047,7 +2047,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 	 * This ensures that tasks getting woken will be fully ordered against
 	 * their previous state and preserve Program Order.
 	 */
-	smp_cond_load_acquire(&p->on_cpu, !VAL);
+	smp_cond_load_acquire(&p->on_cpu, !p->on_cpu);
 
 	p->sched_contributes_to_load = !!task_contributes_to_load(p);
 	p->state = TASK_WAKING;
-- 
2.7.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ