Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277244
b: refs/heads/master
c: dff1672
h: refs/heads/master
v: v3
  • Loading branch information
Paul E. McKenney authored and Paul E. McKenney committed Dec 11, 2011
1 parent 7c68da5 commit 17b3b1b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: facc4e159672b4ed10aa18147bfa187b013c9505
refs/heads/master: dff1672d9199fffddb58fa7970ccf59005fc35f3
5 changes: 4 additions & 1 deletion trunk/kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,10 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
debug_rcu_head_unqueue(list);
__rcu_reclaim(rsp->name, list);
list = next;
if (++count >= bl)
/* Stop only if limit reached and CPU has something to do. */
if (++count >= bl &&
(need_resched() ||
(!is_idle_task(current) && !rcu_is_callbacks_kthread())))
break;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/rcutree.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ static void __init __rcu_init_preempt(void);
static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags);
static void rcu_preempt_boost_start_gp(struct rcu_node *rnp);
static void invoke_rcu_callbacks_kthread(void);
static bool rcu_is_callbacks_kthread(void);
#ifdef CONFIG_RCU_BOOST
static void rcu_preempt_do_callbacks(void);
static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp,
Expand Down
14 changes: 14 additions & 0 deletions trunk/kernel/rcutree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,15 @@ static void invoke_rcu_callbacks_kthread(void)
local_irq_restore(flags);
}

/*
* Is the current CPU running the RCU-callbacks kthread?
* Caller must have preemption disabled.
*/
static bool rcu_is_callbacks_kthread(void)
{
return __get_cpu_var(rcu_cpu_kthread_task) == current;
}

/*
* Set the affinity of the boost kthread. The CPU-hotplug locks are
* held, so no one should be messing with the existence of the boost
Expand Down Expand Up @@ -1780,6 +1789,11 @@ static void invoke_rcu_callbacks_kthread(void)
WARN_ON_ONCE(1);
}

static bool rcu_is_callbacks_kthread(void)
{
return false;
}

static void rcu_preempt_boost_start_gp(struct rcu_node *rnp)
{
}
Expand Down

0 comments on commit 17b3b1b

Please sign in to comment.