lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1336056962-10465-1-git-send-email-gilad@benyossef.com>
Date:	Thu,  3 May 2012 17:55:56 +0300
From:	Gilad Ben-Yossef <gilad@...yossef.com>
To:	linux-kernel@...r.kernel.org
Cc:	Gilad Ben-Yossef <gilad@...yossef.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Tejun Heo <tj@...nel.org>, John Stultz <johnstul@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Mel Gorman <mel@....ul.ie>, Mike Frysinger <vapier@...too.org>,
	David Rientjes <rientjes@...gle.com>,
	Hugh Dickins <hughd@...gle.com>,
	Minchan Kim <minchan.kim@...il.com>,
	Konstantin Khlebnikov <khlebnikov@...nvz.org>,
	Christoph Lameter <cl@...ux.com>,
	Chris Metcalf <cmetcalf@...era.com>,
	Hakan Akkan <hakanakkan@...il.com>,
	Max Krasnyansky <maxk@...lcomm.com>,
	Frederic Weisbecker <fweisbec@...il.com>, linux-mm@...ck.org
Subject: [PATCH v1 0/6] reduce workqueue and timer noise

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@...hub.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@...yossef.com>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Tejun Heo <tj@...nel.org>
CC: John Stultz <johnstul@...ibm.com>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
CC: Mel Gorman <mel@....ul.ie>
CC: Mike Frysinger <vapier@...too.org>
CC: David Rientjes <rientjes@...gle.com>
CC: Hugh Dickins <hughd@...gle.com>
CC: Minchan Kim <minchan.kim@...il.com>
CC: Konstantin Khlebnikov <khlebnikov@...nvz.org>
CC: Christoph Lameter <cl@...ux.com>
CC: Chris Metcalf <cmetcalf@...era.com>
CC: Hakan Akkan <hakanakkan@...il.com>
CC: Max Krasnyansky <maxk@...lcomm.com>
CC: Frederic Weisbecker <fweisbec@...il.com>
CC: linux-kernel@...r.kernel.org
CC: linux-mm@...ck.org

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ