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: <1307692251.15392.91.camel@sli10-conroe>
Date:	Fri, 10 Jun 2011 15:50:51 +0800
From:	Shaohua Li <shaohua.li@...el.com>
To:	lkml <linux-kernel@...r.kernel.org>
Cc:	paulmck@...ux.vnet.ibm.com, Ingo Molnar <mingo@...e.hu>
Subject: [PATCH]rcu: avoid unnecessary thread wakeup

invoke_rcu_cpu_kthread could be called in the thread itself. In this case,
we don't need call wakeup, which is just wasting CPU.

Signed-off-by: Shaohua Li <shaohua.li@...el.com>

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 89419ff..f9bd051 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1475,7 +1475,8 @@ static void invoke_rcu_cpu_kthread(void)
 		local_irq_restore(flags);
 		return;
 	}
-	wake_up_process(__this_cpu_read(rcu_cpu_kthread_task));
+	if (current != __this_cpu_read(rcu_cpu_kthread_task))
+		wake_up_process(__this_cpu_read(rcu_cpu_kthread_task));
 	local_irq_restore(flags);
 }
 


--
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