From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] rcu: remove the context test in rcu_read_unlock_special()
Date: Thu, 29 Mar 2012 16:21:44 +0800 [thread overview]
Message-ID: <4F741B98.2070709@cn.fujitsu.com> (raw)
Because of commit#26861f and #10f39bb1b2, the context test in
rcu_read_unlock_special() are not needed.
commit#26861f and #10f39bb1b2 ensure ->rcu_read_unlock_special is zero
after rcu_read_unlock(), which implies:
if ->rcu_read_unlock_special is non-zero, the out-most RCU C.S. can
be interrupted or can be preempted, such context is safe to
call rcu_read_unlock_special().
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index 22ecea0..22e2ef1 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -571,12 +571,6 @@ static noinline void rcu_read_unlock_special(struct task_struct *t)
if (special & RCU_READ_UNLOCK_NEED_QS)
rcu_preempt_cpu_qs();
- /* Hardware IRQ handlers cannot block. */
- if (in_irq() || in_serving_softirq()) {
- local_irq_restore(flags);
- return;
- }
-
/* Clean up if blocked during RCU read-side critical section. */
if (special & RCU_READ_UNLOCK_BLOCKED) {
t->rcu_read_unlock_special &= ~RCU_READ_UNLOCK_BLOCKED;
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index c023464..2bd3689 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -338,12 +338,6 @@ static noinline void rcu_read_unlock_special(struct task_struct *t)
rcu_preempt_qs(smp_processor_id());
}
- /* Hardware IRQ handlers cannot block. */
- if (in_irq() || in_serving_softirq()) {
- local_irq_restore(flags);
- return;
- }
-
/* Clean up if blocked during RCU read-side critical section. */
if (special & RCU_READ_UNLOCK_BLOCKED) {
t->rcu_read_unlock_special &= ~RCU_READ_UNLOCK_BLOCKED;
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 671f959..7074f97 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -318,12 +318,8 @@ static inline void invoke_softirq(void)
#else
do_softirq();
#endif
- } else {
- __local_bh_disable((unsigned long)__builtin_return_address(0),
- SOFTIRQ_OFFSET);
+ } else
wakeup_softirqd();
- __local_bh_enable(SOFTIRQ_OFFSET);
- }
}
/*
next reply other threads:[~2012-03-29 8:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 8:21 Lai Jiangshan [this message]
2012-03-29 21:56 ` [PATCH] rcu: remove the context test in rcu_read_unlock_special() Paul E. McKenney
2012-04-02 6:32 ` Lai Jiangshan
2012-04-02 14:06 ` Paul E. McKenney
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=4F741B98.2070709@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox