linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 Resend 0/4] Create sched_select_cpu() and use it for workqueues and timers
@ 2012-11-06 10:34 Viresh Kumar
  2012-11-06 10:38 ` [PATCH V2 Resend 3/4] workqueue: Schedule work on non-idle cpu instead of current one Viresh Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 48+ messages in thread
From: Viresh Kumar @ 2012-11-06 10:34 UTC (permalink / raw)
  To: pjt, paul.mckenney, tglx, tj, suresh.b.siddha, venki, mingo,
	peterz, rostedt
  Cc: Arvind.Chauhan, linaro-dev, patches, pdsw-power-team,
	linux-kernel, linux-rt-users, Viresh Kumar

Hi All,

This is V2 Resend of my sched_select_cpu() work. Resend because didn't got much
attention on V2. Including more guys now in cc :)

In order to save power, it would be useful to schedule work onto non-IDLE cpus
instead of waking up an IDLE one.

To achieve this, we need scheduler to guide kernel frameworks (like: timers &
workqueues) on which is the most preferred CPU that must be used for these
tasks.

This patchset is about implementing this concept.

- The first patch adds sched_select_cpu() routine which returns the preferred
  cpu which is non-idle.
- Second patch removes idle_cpu() calls from timer & hrtimer.
- Third patch is about adapting this change in workqueue framework.
- Fourth patch add migration capability in running timer

Earlier discussions over v1 can be found here:
http://www.mail-archive.com/linaro-dev@lists.linaro.org/msg13342.html

Earlier discussions over this concept were done at last LPC:
http://summit.linuxplumbersconf.org/lpc-2012/meeting/90/lpc2012-sched-timer-workqueue/

Module created for testing this behavior is present here:
http://git.linaro.org/gitweb?p=people/vireshk/module.git;a=summary

Following are the steps followed in test module:
1. Run single work on each cpu
2. This work will start a timer after x (tested with 10) jiffies of delay
3. Timer routine queues a work... (This may be called from idle or non-idle cpu)
   and starts the same timer again STEP 3 is done for n number of times (i.e.
   queuing n works, one after other)
4. All works will call a single routine, which will count following per cpu:
 - Total works processed by a CPU
 - Total works processed by a CPU, which are queued from it
 - Total works processed by a CPU, which aren't queued from it

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

Results:
-------
Without Workqueue Modification, i.e. PATCH 3/3:
[ 2493.022335] Workqueue Analyser: works processsed by CPU0, Total: 1000, Own: 0, migrated: 0
[ 2493.047789] Workqueue Analyser: works processsed by CPU1, Total: 1000, Own: 0, migrated: 0
[ 2493.072918] Workqueue Analyser: works processsed by CPU2, Total: 1000, Own: 0, migrated: 0
[ 2493.098576] Workqueue Analyser: works processsed by CPU3, Total: 1000, Own: 0, migrated: 0
[ 2493.123702] Workqueue Analyser: works processsed by CPU4, Total: 1000, Own: 0, migrated: 0

With Workqueue Modification, i.e. PATCH 3/3:
[ 2493.022335] Workqueue Analyser: works processsed by CPU0, Total: 1002, Own: 999, migrated: 3
[ 2493.047789] Workqueue Analyser: works processsed by CPU1, Total: 998,  Own: 997, migrated: 1
[ 2493.072918] Workqueue Analyser: works processsed by CPU2, Total: 1013, Own: 996, migrated: 17
[ 2493.098576] Workqueue Analyser: works processsed by CPU3, Total: 998,  Own: 993, migrated: 5
[ 2493.123702] Workqueue Analyser: works processsed by CPU4, Total: 989,  Own: 987, migrated: 2

V2->V2-Resend
-------------
- Included timer migration patch in the same thread.

V1->V2
-----
- New SD_* macros removed now and earlier ones used
- sched_select_cpu() rewritten and it includes the check on current cpu's
  idleness.
- cpu_idle() calls from timer and hrtimer removed now.
- Patch 2/3 from V1, removed as it doesn't apply to latest workqueue branch from
  tejun.
- CONFIG_MIGRATE_WQ removed and so is wq_select_cpu()
- sched_select_cpu() called only from __queue_work()
- got tejun/for-3.7 branch in my tree, before making workqueue changes.

Viresh Kumar (4):
  sched: Create sched_select_cpu() to give preferred CPU for power
    saving
  timer: hrtimer: Don't check idle_cpu() before calling
    get_nohz_timer_target()
  workqueue: Schedule work on non-idle cpu instead of current one
  timer: Migrate running timer

 include/linux/sched.h | 16 ++++++++++--
 include/linux/timer.h |  2 ++
 kernel/hrtimer.c      |  2 +-
 kernel/sched/core.c   | 69 +++++++++++++++++++++++++++++++--------------------
 kernel/timer.c        | 50 ++++++++++++++++++++++---------------
 kernel/workqueue.c    |  4 +--
 6 files changed, 91 insertions(+), 52 deletions(-)

-- 
1.7.12.rc2.18.g61b472e

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

end of thread, other threads:[~2013-10-23  5:55 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-06 10:34 [PATCH V2 Resend 0/4] Create sched_select_cpu() and use it for workqueues and timers Viresh Kumar
2012-11-06 10:38 ` [PATCH V2 Resend 3/4] workqueue: Schedule work on non-idle cpu instead of current one Viresh Kumar
     [not found]   ` <ad25c731a6ca1bd1269555245952f05c856a9759.1352196505.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-26 17:15     ` Tejun Heo
2012-11-27  5:19       ` Viresh Kumar
2012-11-27 12:54         ` Vincent Guittot
     [not found]         ` <CAKohpom9=K976NmyFWtXx2UQyRcLAqsoGw-5AaqXRpSL6uxP_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-04 11:11           ` Viresh Kumar
2013-01-04 15:09             ` Tejun Heo
2013-01-07  9:58               ` Viresh Kumar
2013-01-07 13:28                 ` Steven Rostedt
2013-01-07 17:59                   ` Viresh Kumar
2013-01-07 22:29                     ` Steven Rostedt
2013-01-08  4:03                       ` Viresh Kumar
2013-01-07 15:04                 ` Tejun Heo
2013-01-07 15:40                   ` Amit Kucheria
2013-01-07 18:07                   ` Viresh Kumar
2013-01-09 18:49                     ` Tejun Heo
2013-01-10  5:04                       ` Viresh Kumar
2012-11-27 13:26   ` Steven Rostedt
2012-11-27 13:48     ` Viresh Kumar
2012-11-27 13:59       ` Steven Rostedt
2012-11-27 14:55         ` Vincent Guittot
2012-11-27 15:04           ` Steven Rostedt
2012-11-27 15:35             ` Vincent Guittot
     [not found] ` <cover.1352196505.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-06 10:38   ` [PATCH V2 Resend 1/4] sched: Create sched_select_cpu() to give preferred CPU for power saving Viresh Kumar
2012-11-06 10:38   ` [PATCH V2 Resend 2/4] timer: hrtimer: Don't check idle_cpu() before calling get_nohz_timer_target() Viresh Kumar
2012-11-06 10:38   ` [PATCH V2 Resend 4/4] timer: Migrate running timer Viresh Kumar
2012-11-27 13:47     ` Steven Rostedt
2013-03-20 15:13       ` Viresh Kumar
2013-04-09 14:52         ` Viresh Kumar
2013-04-24 11:22           ` Viresh Kumar
2013-05-13  9:19             ` Viresh Kumar
2013-05-13 10:35               ` Thomas Gleixner
2013-05-22  8:34                 ` Viresh Kumar
2013-05-22  9:06                   ` Peter Zijlstra
2013-05-22  9:23                     ` Viresh Kumar
2013-05-31 10:49                   ` Viresh Kumar
2013-06-18  4:51                     ` Viresh Kumar
2013-07-24  9:17                       ` Viresh Kumar
2013-08-07  9:55                         ` Viresh Kumar
2013-10-04 12:39                           ` Sebastian Andrzej Siewior
2013-10-23  5:55                             ` Viresh Kumar
2012-11-26 15:00 ` [PATCH V2 Resend 0/4] Create sched_select_cpu() and use it for workqueues and timers Viresh Kumar
2012-11-26 16:40   ` Steven Rostedt
     [not found]     ` <1353948027.6276.38.camel-f9ZlEuEWxVcJvu8Pb33WZ0EMvNT87kid@public.gmane.org>
2012-11-26 17:03       ` Paul E. McKenney
2012-11-26 17:35         ` Steven Rostedt
     [not found]           ` <1353951352.6276.43.camel-f9ZlEuEWxVcJvu8Pb33WZ0EMvNT87kid@public.gmane.org>
2012-11-26 19:03             ` Paul E. McKenney
2012-11-26 19:17               ` Steven Rostedt
2012-11-27  6:25     ` Viresh Kumar

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).