All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-kernel@vger.kernel.org
Cc: Dipankar Sarma <dipankar@in.ibm.com>,
	Manfred Spraul <manfred@colorfullife.com>,
	Andrew Morton <akpm@osdl.org>
Subject: [PATCH 1/2] rcu: cosmetic, delete wrong comment, use HARDIRQ_OFFSET
Date: Sun, 28 Nov 2004 18:06:52 +0300	[thread overview]
Message-ID: <41A9E98C.2C1D07EF@tv-sign.ru> (raw)

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

             reply	other threads:[~2004-11-28 14:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-28 15:06 Oleg Nesterov [this message]
2004-11-28 14:31 ` [PATCH 1/2] rcu: cosmetic, delete wrong comment, use HARDIRQ_OFFSET 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41A9E98C.2C1D07EF@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.