All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Paul E. McKenney" <paulmck@us.ibm.com>,
	Dipankar Sarma <dipankar@in.ibm.com>,
	Srivatsa Vaddagiri <vatsa@in.ibm.com>,
	Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] force_quiescent_state: factor out duplicated code
Date: Sun, 10 Sep 2006 20:18:10 +0400	[thread overview]
Message-ID: <20060910161810.GA10262@oleg> (raw)

On top of rcu-simplify-improve-batch-tuning.patch

Cleanup. Move '#ifdef CONFIG_SMP' check and rdp->bhlimit setting
into force_quiescent_state().

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

--- 18-rc6/kernel/rcupdate.c~2_fold	2006-09-10 16:56:10.000000000 +0400
+++ 18-rc6/kernel/rcupdate.c	2006-09-10 20:00:31.000000000 +0400
@@ -76,14 +76,17 @@ static atomic_t rcu_barrier_cpu_count;
 static DEFINE_MUTEX(rcu_barrier_mutex);
 static struct completion rcu_barrier_completion;
 
-#ifdef CONFIG_SMP
 static void force_quiescent_state(struct rcu_data *rdp,
-			struct rcu_ctrlblk *rcp)
+				struct rcu_ctrlblk *rcp)
 {
-	int cpu;
-	cpumask_t cpumask;
+	rdp->blimit = INT_MAX;
 	set_need_resched();
+
+#ifdef CONFIG_SMP
 	if (unlikely(!rcp->signaled)) {
+		cpumask_t cpumask;
+		int cpu;
+
 		rcp->signaled = 1;
 		/*
 		 * Don't send IPI to itself. With irqs disabled,
@@ -94,14 +97,8 @@ static void force_quiescent_state(struct
 		for_each_cpu_mask(cpu, cpumask)
 			smp_send_reschedule(cpu);
 	}
-}
-#else
-static inline void force_quiescent_state(struct rcu_data *rdp,
-			struct rcu_ctrlblk *rcp)
-{
-	set_need_resched();
-}
 #endif
+}
 
 /**
  * call_rcu - Queue an RCU callback for invocation after a grace period.
@@ -126,10 +123,9 @@ void fastcall call_rcu(struct rcu_head *
 	rdp = &__get_cpu_var(rcu_data);
 	*rdp->nxttail = head;
 	rdp->nxttail = &head->next;
-	if (unlikely(++rdp->qlen > qhimark)) {
-		rdp->blimit = INT_MAX;
+
+	if (unlikely(++rdp->qlen > qhimark))
 		force_quiescent_state(rdp, &rcu_ctrlblk);
-	}
 	local_irq_restore(flags);
 }
 
@@ -162,11 +158,8 @@ void fastcall call_rcu_bh(struct rcu_hea
 	*rdp->nxttail = head;
 	rdp->nxttail = &head->next;
 
-	if (unlikely(++rdp->qlen > qhimark)) {
-		rdp->blimit = INT_MAX;
+	if (unlikely(++rdp->qlen > qhimark))
 		force_quiescent_state(rdp, &rcu_bh_ctrlblk);
-	}
-
 	local_irq_restore(flags);
 }
 


             reply	other threads:[~2006-09-10 16:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-10 16:18 Oleg Nesterov [this message]
2006-09-10 21:03 ` [PATCH] force_quiescent_state: factor out duplicated code Dipankar Sarma
2006-09-10 21:13   ` 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=20060910161810.GA10262@oleg \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@us.ibm.com \
    --cc=vatsa@in.ibm.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.