Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1443778
| From | Chris Metcalf <cmetcalf@mellanox.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v13 01/12] vmstat: add quiet_vmstat_sync function |
| Date | 2016-07-14 23:00 +0200 |
| Message-ID | <rUVTI-62L-27@gated-at.bofh.it> (permalink) |
| References | <rUVK1-5Zr-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
In commit f01f17d3705b ("mm, vmstat: make quiet_vmstat lighter")
the quiet_vmstat() function became asynchronous, in the sense that
the vmstat work was still scheduled to run on the core when the
function returned. For task isolation, we need a synchronous
version of the function that guarantees that the vmstat worker
will not run on the core on return from the function. Add a
quiet_vmstat_sync() function with that semantic.
Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
---
include/linux/vmstat.h | 2 ++
mm/vmstat.c | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index d2da8e053210..0d96b6b2079d 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -188,6 +188,7 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item);
extern void __dec_zone_state(struct zone *, enum zone_stat_item);
void quiet_vmstat(void);
+void quiet_vmstat_sync(void);
void cpu_vm_stats_fold(int cpu);
void refresh_zone_stat_thresholds(void);
@@ -253,6 +254,7 @@ static inline void __dec_zone_page_state(struct page *page,
static inline void refresh_zone_stat_thresholds(void) { }
static inline void cpu_vm_stats_fold(int cpu) { }
static inline void quiet_vmstat(void) { }
+static inline void quiet_vmstat_sync(void) { }
static inline void drain_zonestat(struct zone *zone,
struct per_cpu_pageset *pset) { }
diff --git a/mm/vmstat.c b/mm/vmstat.c
index cb2a67bb4158..945af7ab624e 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1483,6 +1483,15 @@ void quiet_vmstat(void)
}
/*
+ * Synchronously quiet vmstat so the work is guaranteed not to run on return.
+ */
+void quiet_vmstat_sync(void)
+{
+ cancel_delayed_work_sync(this_cpu_ptr(&vmstat_work));
+ refresh_cpu_vm_stats(false);
+}
+
+/*
* Shepherd worker thread that checks the
* differentials of processors that have their worker
* threads for vm statistics updates disabled because of
--
2.7.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v13 00/12] support "task_isolation" mode Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 22:50 +0200
[PATCH v13 12/12] task_isolation: add user-settable notification signal Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 22:50 +0200
[PATCH v13 06/12] arch/x86: enable task isolation functionality Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 22:50 +0200
[PATCH v13 03/12] lru_add_drain_all: factor out lru_add_drain_needed Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 22:50 +0200
[PATCH v13 04/12] task_isolation: add initial support Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 22:50 +0200
[PATCH v13 09/12] arch/tile: enable task isolation functionality Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 23:00 +0200
[PATCH v13 01/12] vmstat: add quiet_vmstat_sync function Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 23:00 +0200
[PATCH v13 05/12] task_isolation: track asynchronous interrupts Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-14 23:00 +0200
Re: [PATCH v13 00/12] support "task_isolation" mode Andy Lutomirski <luto@amacapital.net> - 2016-07-14 23:10 +0200
Re: [PATCH v13 00/12] support "task_isolation" mode Christoph Lameter <cl@linux.com> - 2016-07-18 02:50 +0200
Re: [PATCH v13 00/12] support "task_isolation" mode Andy Lutomirski <luto@amacapital.net> - 2016-07-19 00:20 +0200
Re: [PATCH v13 00/12] support "task_isolation" mode Christoph Lameter <cl@linux.com> - 2016-07-21 04:10 +0200
Re: [PATCH v13 00/12] support "task_isolation" mode Christoph Lameter <cl@linux.com> - 2016-07-22 04:30 +0200
Re: [PATCH v13 00/12] support "task_isolation" mode Christoph Lameter <cl@linux.com> - 2016-07-25 18:40 +0200
csiph-web