From 12186d2e6f45ed6e54ab73a7931f653cdac7b9bb Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Wed, 20 Mar 2013 03:28:10 +0800 Subject: [PATCH] --- yaml --- r: 365531 b: refs/heads/master c: 881094532e2a27406a5f06f839087bd152a8a494 h: refs/heads/master i: 365529: efdca879fd82870a6c718ef47d377568e95d6710 365527: 96dfe00725cbdf43344176d336ad4e9da160a235 v: v3 --- [refs] | 2 +- trunk/kernel/workqueue.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 64ce8373c736..2f60e3436451 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 951a078a5285ad31bc22e190616ad54b78fac992 +refs/heads/master: 881094532e2a27406a5f06f839087bd152a8a494 diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 79d1d347e690..b6c5a524d7c4 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -3962,7 +3962,7 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) struct pool_workqueue *pwq; bool ret; - preempt_disable(); + rcu_read_lock_sched(); if (!(wq->flags & WQ_UNBOUND)) pwq = per_cpu_ptr(wq->cpu_pwqs, cpu); @@ -3970,7 +3970,7 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq) pwq = first_pwq(wq); ret = !list_empty(&pwq->delayed_works); - preempt_enable(); + rcu_read_unlock_sched(); return ret; } @@ -4354,16 +4354,16 @@ bool freeze_workqueues_busy(void) * nr_active is monotonically decreasing. It's safe * to peek without lock. */ - preempt_disable(); + rcu_read_lock_sched(); for_each_pwq(pwq, wq) { WARN_ON_ONCE(pwq->nr_active < 0); if (pwq->nr_active) { busy = true; - preempt_enable(); + rcu_read_unlock_sched(); goto out_unlock; } } - preempt_enable(); + rcu_read_unlock_sched(); } out_unlock: mutex_unlock(&wq_mutex);