Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164322
b: refs/heads/master
c: 89f19f0
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Ingo Molnar committed Sep 20, 2009
1 parent 44d1a6d commit b168f08
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 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: 3f04e8cd5b24727a2500f8ab8f3de730ba47b02c
refs/heads/master: 89f19f04dc72363d912fd007a399cb10310eff6e
2 changes: 1 addition & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ extern asmlinkage void schedule_tail(struct task_struct *prev);
extern void init_idle(struct task_struct *idle, int cpu);
extern void init_idle_bootup_task(struct task_struct *idle);

extern int runqueue_is_locked(void);
extern int runqueue_is_locked(int cpu);
extern void task_rq_unlock_wait(struct task_struct *p);

extern cpumask_var_t nohz_cpu_mask;
Expand Down
10 changes: 2 additions & 8 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,15 +681,9 @@ inline void update_rq_clock(struct rq *rq)
* This interface allows printk to be called with the runqueue lock
* held and know whether or not it is OK to wake up the klogd.
*/
int runqueue_is_locked(void)
int runqueue_is_locked(int cpu)
{
int cpu = get_cpu();
struct rq *rq = cpu_rq(cpu);
int ret;

ret = spin_is_locked(&rq->lock);
put_cpu();
return ret;
return spin_is_locked(&cpu_rq(cpu)->lock);
}

/*
Expand Down
8 changes: 7 additions & 1 deletion trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,18 @@ static DEFINE_SPINLOCK(tracing_start_lock);
*/
void trace_wake_up(void)
{
int cpu;

if (trace_flags & TRACE_ITER_BLOCK)
return;
/*
* The runqueue_is_locked() can fail, but this is the best we
* have for now:
*/
if (!(trace_flags & TRACE_ITER_BLOCK) && !runqueue_is_locked())
cpu = get_cpu();
if (!runqueue_is_locked(cpu))
wake_up(&trace_wait);
put_cpu();
}

static int __init set_buf_size(char *str)
Expand Down

0 comments on commit b168f08

Please sign in to comment.