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>] [day] [month] [year] [list]
Date:	Mon, 9 Jul 2012 20:24:38 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>,
	Hillf Danton <dhillf@...il.com>
Subject: [patch] BFS 421-1: refactor sys_sched_yield

Runqueue lock is replaced with preempt.

SOB: Hillf Danton <dhillf@...il.com>
---

--- a/kernel/sched/bfs.c	Mon Jul  9 20:06:50 2012
+++ b/kernel/sched/bfs.c	Mon Jul  9 20:08:50 2012
@@ -4518,19 +4518,8 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t
  */
 SYSCALL_DEFINE0(sched_yield)
 {
-	struct task_struct *p;
-
-	p = current;
-	grq_lock_irq();
-	schedstat_inc(task_rq(p), yld_count);
-
-	/*
-	 * Since we are going to call schedule() anyway, there's
-	 * no need to preempt or enable interrupts:
-	 */
-	__release(grq.lock);
-	spin_release(&grq.lock.dep_map, 1, _THIS_IP_);
-	do_raw_spin_unlock(&grq.lock);
+	preempt_disable();
+	schedstat_inc(this_rq(), yld_count);
 	preempt_enable_no_resched();

 	schedule();
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ