linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V5 0/5] Queue work on power efficient wq
@ 2013-04-24 11:42 Viresh Kumar
  2013-04-24 11:42 ` [PATCH V5 1/5] workqueues: Introduce new flag WQ_POWER_EFFICIENT for power oriented workqueues Viresh Kumar
                   ` (6 more replies)
  0 siblings, 7 replies; 28+ messages in thread
From: Viresh Kumar @ 2013-04-24 11:42 UTC (permalink / raw)
  To: tj
  Cc: davem, airlied, axboe, tglx, peterz, mingo, rostedt,
	linux-rt-users, linux-kernel, robin.randhawa, Steve.Bannister,
	Liviu.Dudau, charles.garcia-tobin, arvind.chauhan, linaro-kernel,
	patches, Viresh Kumar

This patchset was called: "Create sched_select_cpu() and use it for workqueues"
for the first three versions.

Earlier discussions over v3, v2 and v1 can be found here:
https://lkml.org/lkml/2013/3/18/364
http://lists.linaro.org/pipermail/linaro-dev/2012-November/014344.html
http://www.mail-archive.com/linaro-dev@lists.linaro.org/msg13342.html

V4 is here:
https://lkml.org/lkml/2013/3/31/55

Workqueues can be performance or power oriented. For performance we may want to
keep them running on a single cpu, so that it remains cache hot. For power we
can give scheduler the liberty to choose target cpu for running work handler.

Later one (Power oriented WQ) can be achieved if the workqueue is allocated with
WQ_UNBOUND flag. Enabling CONFIG_WQ_POWER_EFFICIENT will set
'wq_power_efficient' to 'true'. Setting 'power_efficient' boot param will
override value of 'wq_power_efficient' variable. When 'wq_power_efficient' is
set to 'true', we will convert WQ_POWER_EFFICIENT flag to WQ_UNBOUND on wq
allocation. And so scheduler will have the liberty to choose where to run this
work.

Here we are migrating few users of workqueues to WQ_POWER_EFFICIENT. These
drivers are found to be very much active on idle or lightly busy system and
using WQ_POWER_EFFICIENT for these gave impressive results.

These would be used in power saving mode only if relevant configs are enabled
at compile time or in bootargs. Otherwise behavior is unchanged.

Setup:
-----
- ARM Vexpress TC2 - big.LITTLE CPU
- Core 0-1: A15, 2-4: A7
- rootfs: linaro-ubuntu-devel

This patchset has been tested on a big LITTLE system (heterogeneous) but is
useful for all other homogeneous systems as well. During these tests audio was
played in background using aplay.

Results:
-------

Cluster A15 Energy      Cluster A7 Energy       Total
-------------------------      -----------------------       ------

Without this patchset (Energy in Joules):
---------------------------------------------------

0.151162                2.183545                2.334707
0.223730                2.687067                2.910797
0.289687                2.732702                3.022389
0.454198                2.745908                3.200106
0.495552                2.746465                3.242017

Average:
0.322866                2.619137                2.942003


With this patchset (Energy in Joules):
-----------------------------------------------

0.226421                2.283658                2.510079
0.151361                2.236656                2.388017
0.197726                2.249849                2.447575
0.221915                2.229446                2.451361
0.347098                2.257707                2.604805

Average:
0.2289042              2.2514632              2.4803674

Above tests are repeated multiple times and events are tracked using trace-cmd
and analysed using kernelshark. And it was easily noticeable that idle time for
many cpus has increased considerably, which eventually saved some power.

V4->V5:
-------
- Created new wq flag: WQ_POWER_EFFICIENT, config option:
  CONFIG_WQ_POWER_EFFICIENT and kernel param workqueue.power_efficient.
- Created few system wide workqueues aligned towards power saving.

V3->V4:
-------
- Dropped changes to kernel/sched directory and hence
  sched_select_non_idle_cpu().
- Dropped queue_work_on_any_cpu()
- Created system_freezable_unbound_wq
- Changed all patches accordingly.

V2->V3:
-------
- Dropped changes into core queue_work() API, rather create *_on_any_cpu()
  APIs
- Dropped running timers migration patch as that was broken
- Migrated few users of workqueues to use *_on_any_cpu() APIs.

Viresh Kumar (5):
  workqueues: Introduce new flag WQ_POWER_EFFICIENT for power oriented
    workqueues
  workqueue: Add system wide power_efficient workqueues
  PHYLIB: queue work on system_power_efficient_wq
  block: queue work on power efficient wq
  fbcon: queue work on power efficient wq

 Documentation/kernel-parameters.txt | 17 +++++++++++++++++
 block/blk-core.c                    |  3 ++-
 block/blk-ioc.c                     |  3 ++-
 block/genhd.c                       | 12 ++++++++----
 drivers/net/phy/phy.c               |  9 +++++----
 drivers/video/console/fbcon.c       |  2 +-
 include/linux/workqueue.h           | 10 ++++++++++
 kernel/power/Kconfig                | 19 +++++++++++++++++++
 kernel/workqueue.c                  | 24 +++++++++++++++++++++++-
 9 files changed, 87 insertions(+), 12 deletions(-)

-- 
1.7.12.rc2.18.g61b472e

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2013-07-08 18:55 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 11:42 [PATCH V5 0/5] Queue work on power efficient wq Viresh Kumar
2013-04-24 11:42 ` [PATCH V5 1/5] workqueues: Introduce new flag WQ_POWER_EFFICIENT for power oriented workqueues Viresh Kumar
2013-04-24 12:20   ` Amit Kucheria
2013-04-24 12:27     ` Viresh Kumar
2013-04-24 16:12       ` Tejun Heo
     [not found]         ` <CAP245DUGuaSQbP4026N8kgn6-NqXFJWR3zKoYud=HQ_b+v5+Xw@mail.gmail.com>
2013-04-25  3:43           ` Viresh Kumar
2013-04-25 11:13             ` Amit Kucheria
2013-04-25 11:15               ` Viresh Kumar
2013-04-26 19:11             ` Tejun Heo
2013-04-29  6:36               ` Viresh Kumar
2013-04-29 16:19                 ` Tejun Heo
2013-04-29 16:42                   ` Viresh Kumar
2013-05-13  8:29               ` Viresh Kumar
2013-05-14 17:55                 ` Tejun Heo
2013-04-24 11:42 ` [PATCH V5 2/5] workqueue: Add system wide power_efficient workqueues Viresh Kumar
2013-05-14 17:56   ` Tejun Heo
2013-04-24 11:42 ` [PATCH V5 3/5] PHYLIB: queue work on system_power_efficient_wq Viresh Kumar
2013-04-24 11:42 ` [PATCH V5 4/5] block: queue work on power efficient wq Viresh Kumar
2013-05-14 17:57   ` Tejun Heo
2013-04-24 11:42 ` [PATCH V5 5/5] fbcon: " Viresh Kumar
2013-05-14 17:57   ` Tejun Heo
2013-05-14 17:54 ` [PATCH V5 0/5] Queue " Tejun Heo
2013-05-15  5:48   ` Viresh Kumar
2013-07-08 15:37 ` Uwe Kleine-König
2013-07-08 15:47   ` Viresh Kumar
2013-07-08 15:57     ` Uwe Kleine-König
2013-07-08 16:48       ` Viresh Kumar
2013-07-08 18:55         ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).