提交 caa9ee77 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

[PATCH] rcu_process_callbacks: don't cli() while testing ->nxtlist

__rcu_process_callbacks() disables interrupts to protect itself from
call_rcu() which adds new entries to ->nxtlist.

However we can check "->nxtlist != NULL" with interrupts enabled, we can't
get "false positives" because call_rcu() can only change this condition
from 0 to 1.

Tested with rcutorture.ko.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Acked-by: NDipankar Sarma <dipankar@in.ibm.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 cba9f33d
...@@ -416,8 +416,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp, ...@@ -416,8 +416,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp,
rdp->curtail = &rdp->curlist; rdp->curtail = &rdp->curlist;
} }
local_irq_disable();
if (rdp->nxtlist && !rdp->curlist) { if (rdp->nxtlist && !rdp->curlist) {
local_irq_disable();
rdp->curlist = rdp->nxtlist; rdp->curlist = rdp->nxtlist;
rdp->curtail = rdp->nxttail; rdp->curtail = rdp->nxttail;
rdp->nxtlist = NULL; rdp->nxtlist = NULL;
...@@ -442,9 +442,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp, ...@@ -442,9 +442,8 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp,
rcu_start_batch(rcp); rcu_start_batch(rcp);
spin_unlock(&rcp->lock); spin_unlock(&rcp->lock);
} }
} else {
local_irq_enable();
} }
rcu_check_quiescent_state(rcp, rdp); rcu_check_quiescent_state(rcp, rdp);
if (rdp->donelist) if (rdp->donelist)
rcu_do_batch(rdp); rcu_do_batch(rdp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册