All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] rcu: cosmetic, delete wrong comment, use HARDIRQ_OFFSET
@ 2004-11-28 15:06 Oleg Nesterov
  2004-11-28 14:31 ` William Lee Irwin III
  2004-11-28 15:19 ` Dipankar Sarma
  0 siblings, 2 replies; 7+ messages in thread
From: Oleg Nesterov @ 2004-11-28 15:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dipankar Sarma, Manfred Spraul, Andrew Morton

Hello.

rcu_check_quiescent_state:
	/*
	 * Races with local timer interrupt - in the worst case
	 * we may miss one quiescent state of that CPU. That is
	 * tolerable. So no need to disable interrupts.
	 */
	if (rdp->qsctr == rdp->last_qsctr)
		return;

Afaics, this comment is misleading. rcu_check_quiescent_state()
is executed in softirq context, while rcu_check_callbacks() checks
in_softirq() before ++qsctr.

Also, replace (1 << HARDIRQ_SHIFT) by HARDIRQ_OFFSET.

On top of the 'rcu: eliminate rcu_ctrlblk.lock', see
http://marc.theaimsgroup.com/?l=linux-kernel&m=110156786721526

Oleg.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.10-rc2/kernel/rcupdate.c~	2004-11-27 21:40:02.000000000 +0300
+++ 2.6.10-rc2/kernel/rcupdate.c	2004-11-28 17:29:19.084446040 +0300
@@ -229,11 +229,6 @@ static void rcu_check_quiescent_state(st
 	if (!rdp->qs_pending)
 		return;
 
-	/* 
-	 * Races with local timer interrupt - in the worst case
-	 * we may miss one quiescent state of that CPU. That is
-	 * tolerable. So no need to disable interrupts.
-	 */
 	if (rdp->qsctr == rdp->last_qsctr)
 		return;
 	rdp->qs_pending = 0;
@@ -358,7 +353,7 @@ void rcu_check_callbacks(int cpu, int us
 {
 	if (user || 
 	    (idle_cpu(cpu) && !in_softirq() && 
-				hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
+				hardirq_count() <= HARDIRQ_OFFSET)) {
 		rcu_qsctr_inc(cpu);
 		rcu_bh_qsctr_inc(cpu);
 	} else if (!in_softirq())

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-28 16:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-28 15:06 [PATCH 1/2] rcu: cosmetic, delete wrong comment, use HARDIRQ_OFFSET Oleg Nesterov
2004-11-28 14:31 ` William Lee Irwin III
2004-11-28 16:06   ` Oleg Nesterov
2004-11-28 15:19 ` Dipankar Sarma
2004-11-28 15:24   ` Manfred Spraul
2004-11-28 15:42     ` Dipankar Sarma
2004-11-28 17:36       ` Oleg Nesterov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.