diff options
| author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-04-24 07:42:56 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2013-05-14 13:50:07 -0400 |
| commit | 695588f9454bdbc7c1a2fbb8a6bfdcfba6183348 (patch) | |
| tree | 4a9963696a82937133acaa8ea682c88ff3d798af /block/genhd.c | |
| parent | bbb47bdeae756f04b896b55b51f230f3eb21f207 (diff) | |
block: queue work on power efficient wq
Block layer uses workqueues for multiple purposes. There is no real dependency
of scheduling these on the cpu which scheduled them.
On a idle system, it is observed that and idle cpu wakes up many times just to
service this work. It would be better if we can schedule it on a cpu which the
scheduler believes to be the most appropriate one.
This patch replaces normal workqueues with power efficient versions.
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/genhd.c')
| -rw-r--r-- | block/genhd.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/block/genhd.c b/block/genhd.c index 20625eed5511..e9094b375c05 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
| @@ -1489,9 +1489,11 @@ static void __disk_unblock_events(struct gendisk *disk, bool check_now) | |||
| 1489 | intv = disk_events_poll_jiffies(disk); | 1489 | intv = disk_events_poll_jiffies(disk); |
| 1490 | set_timer_slack(&ev->dwork.timer, intv / 4); | 1490 | set_timer_slack(&ev->dwork.timer, intv / 4); |
| 1491 | if (check_now) | 1491 | if (check_now) |
| 1492 | queue_delayed_work(system_freezable_wq, &ev->dwork, 0); | 1492 | queue_delayed_work(system_freezable_power_efficient_wq, |
| 1493 | &ev->dwork, 0); | ||
| 1493 | else if (intv) | 1494 | else if (intv) |
| 1494 | queue_delayed_work(system_freezable_wq, &ev->dwork, intv); | 1495 | queue_delayed_work(system_freezable_power_efficient_wq, |
| 1496 | &ev->dwork, intv); | ||
| 1495 | out_unlock: | 1497 | out_unlock: |
| 1496 | spin_unlock_irqrestore(&ev->lock, flags); | 1498 | spin_unlock_irqrestore(&ev->lock, flags); |
| 1497 | } | 1499 | } |
| @@ -1534,7 +1536,8 @@ void disk_flush_events(struct gendisk *disk, unsigned int mask) | |||
| 1534 | spin_lock_irq(&ev->lock); | 1536 | spin_lock_irq(&ev->lock); |
| 1535 | ev->clearing |= mask; | 1537 | ev->clearing |= mask; |
| 1536 | if (!ev->block) | 1538 | if (!ev->block) |
| 1537 | mod_delayed_work(system_freezable_wq, &ev->dwork, 0); | 1539 | mod_delayed_work(system_freezable_power_efficient_wq, |
| 1540 | &ev->dwork, 0); | ||
| 1538 | spin_unlock_irq(&ev->lock); | 1541 | spin_unlock_irq(&ev->lock); |
| 1539 | } | 1542 | } |
| 1540 | 1543 | ||
| @@ -1627,7 +1630,8 @@ static void disk_check_events(struct disk_events *ev, | |||
| 1627 | 1630 | ||
| 1628 | intv = disk_events_poll_jiffies(disk); | 1631 | intv = disk_events_poll_jiffies(disk); |
| 1629 | if (!ev->block && intv) | 1632 | if (!ev->block && intv) |
| 1630 | queue_delayed_work(system_freezable_wq, &ev->dwork, intv); | 1633 | queue_delayed_work(system_freezable_power_efficient_wq, |
| 1634 | &ev->dwork, intv); | ||
| 1631 | 1635 | ||
| 1632 | spin_unlock_irq(&ev->lock); | 1636 | spin_unlock_irq(&ev->lock); |
| 1633 | 1637 | ||
