linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/6] reduce workqueue and timer noise
@ 2012-05-03 14:55 Gilad Ben-Yossef
  2012-05-03 14:55 ` [PATCH v1 1/6] timer: make __next_timer_interrupt explicit about no future event Gilad Ben-Yossef
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Gilad Ben-Yossef @ 2012-05-03 14:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Gilad Ben-Yossef, Thomas Gleixner, Tejun Heo, John Stultz,
	Andrew Morton, KOSAKI Motohiro, Mel Gorman, Mike Frysinger,
	David Rientjes, Hugh Dickins, Minchan Kim, Konstantin Khlebnikov,
	Christoph Lameter, Chris Metcalf, Hakan Akkan, Max Krasnyansky,
	Frederic Weisbecker, linux-mm

Timers and work queues both provide a useful way to defer work 
for a later time or a different context. However, when the 
timer or work item runs, it interrupts the CPU it is running on.
This is good if it is doing useful work, but it turns out this 
is not always the case.

This patch set tries to locate and address code paths where work queues
items and timers are scheduled on CPUs where they have no useful work 
to do and adapet them to be more selective.

This includes:

- Introducing helper function to schedule work queue items on a subset
  of CPUs in the system.
- Use the helper function to schedule work items to attempt to drain
  LRUs only on CPUs where there are LRU pages.
- Stop running the per cpu work item that does per-cpu pages reclaim 
  and VM statistics on CPUs that did not have any VM activity for the 
  last second (time frame configurable) and re-start it when VM
  activity is detected.
- Fix a bug that prevented the timer code to to not program the 
  underlying HW timer to fire periodically when no future timer 
  event exists for a CPU

Changelog:

- The vmstat_update patch was changed to use a scapegoat CPU as
  suggested by Christoph Lameter when the patch was previously
  discussed in response to Frederic Weisbecker's adaptive tick 
  patch set.

Also included is a testing only patch, not intdented for mainline,
that turns the clock source watchdog into a config option which
I used while testing the timer code fix change.

The patch was boot tested on 32bit x86 in 8 way SMP and UP VMs.

For you reference, I keep a todo list for these and other noise sources 
at: https://github.com/gby/linux/wiki

The git branched can be fetched from the git repo at 
git@github.com:gby/linux.git on the reduce_workqueue_and_timers_noise_v1 
branch

Gilad Ben-Yossef (6):
  timer: make __next_timer_interrupt explicit about no future event
  workqueue: introduce schedule_on_each_cpu_mask
  workqueue: introduce schedule_on_each_cpu_cond
  mm: make lru_drain selective where it schedules work
  mm: make vmstat_update periodic run conditional
  x86: make clocksource watchdog configurable (not for mainline)

 arch/x86/Kconfig          |    9 +++-
 include/linux/vmstat.h    |    2 +-
 include/linux/workqueue.h |    4 ++
 kernel/time/clocksource.c |    2 +
 kernel/timer.c            |   31 ++++++++++-----
 kernel/workqueue.c        |   73 ++++++++++++++++++++++++++++++----
 mm/swap.c                 |   25 +++++++++++-
 mm/vmstat.c               |   95 ++++++++++++++++++++++++++++++++++++++-------
 8 files changed, 204 insertions(+), 37 deletions(-)

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Tejun Heo <tj@kernel.org>
CC: John Stultz <johnstul@us.ibm.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Mel Gorman <mel@csn.ul.ie>
CC: Mike Frysinger <vapier@gentoo.org>
CC: David Rientjes <rientjes@google.com>
CC: Hugh Dickins <hughd@google.com>
CC: Minchan Kim <minchan.kim@gmail.com>
CC: Konstantin Khlebnikov <khlebnikov@openvz.org>
CC: Christoph Lameter <cl@linux.com>
CC: Chris Metcalf <cmetcalf@tilera.com>
CC: Hakan Akkan <hakanakkan@gmail.com>
CC: Max Krasnyansky <maxk@qualcomm.com>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: linux-kernel@vger.kernel.org
CC: linux-mm@kvack.org

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-05-25 21:04 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-03 14:55 [PATCH v1 0/6] reduce workqueue and timer noise Gilad Ben-Yossef
2012-05-03 14:55 ` [PATCH v1 1/6] timer: make __next_timer_interrupt explicit about no future event Gilad Ben-Yossef
2012-05-04 12:04   ` Frederic Weisbecker
2012-05-04 12:20     ` Frederic Weisbecker
2012-05-25 20:48   ` Thomas Gleixner
2012-05-25 20:56     ` Chris Metcalf
2012-05-25 21:04       ` Thomas Gleixner
2012-05-03 14:55 ` [PATCH v1 2/6] workqueue: introduce schedule_on_each_cpu_mask Gilad Ben-Yossef
2012-05-04  4:44   ` Srivatsa S. Bhat
2012-05-03 14:55 ` [PATCH v1 3/6] workqueue: introduce schedule_on_each_cpu_cond Gilad Ben-Yossef
2012-05-03 15:39   ` Tejun Heo
2012-05-06 13:15     ` Gilad Ben-Yossef
2012-05-07 17:17       ` Tejun Heo
2012-05-09 14:26         ` Gilad Ben-Yossef
2012-05-04  4:51   ` Srivatsa S. Bhat
2012-05-06 13:16     ` Gilad Ben-Yossef
2012-05-03 14:56 ` [PATCH v1 4/6] mm: make lru_drain selective where it schedules work Gilad Ben-Yossef
2012-05-03 14:56 ` [PATCH v1 5/6] mm: make vmstat_update periodic run conditional Gilad Ben-Yossef
2012-05-07 15:29   ` Christoph Lameter
2012-05-07 19:33     ` KOSAKI Motohiro
2012-05-07 19:40       ` Christoph Lameter
2012-05-08 15:25         ` Gilad Ben-Yossef
2012-05-08 15:34           ` Christoph Lameter
2012-05-09 14:26             ` Gilad Ben-Yossef
2012-05-08 15:22       ` Gilad Ben-Yossef
2012-05-08 15:18     ` Gilad Ben-Yossef
2012-05-08 15:24       ` Christoph Lameter
2012-05-03 14:56 ` [PATCH v1 6/6] x86: make clocksource watchdog configurable (not for mainline) Gilad Ben-Yossef

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