[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160321143423.GD21248@dhcp22.suse.cz>
Date: Mon, 21 Mar 2016 15:34:23 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Chris Metcalf <cmetcalf@...lanox.com>
Cc: Gilad Ben Yossef <giladb@...hip.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>, Tejun Heo <tj@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Christoph Lameter <cl@...ux.com>,
Viresh Kumar <viresh.kumar@...aro.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Andy Lutomirski <luto@...capital.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v11 01/13] vmstat: add quiet_vmstat_sync function
On Fri 11-03-16 17:10:11, Chris Metcalf wrote:
> 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.
The full series hasn't reached my inbox and from the above it is not
really clear where is the new function supposed to be used.
It is usually preferable to include the consumer of the new API in the
same patch. Is this case any special that it couldn't be done that way?
> Signed-off-by: Chris Metcalf <cmetcalf@...lanox.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 73fae8c4a5fb..43b2f1c33266 100644
> --- a/include/linux/vmstat.h
> +++ b/include/linux/vmstat.h
> @@ -190,6 +190,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);
>
> @@ -251,6 +252,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 084c6725b373..ff569246fcb5 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1469,6 +1469,15 @@ void quiet_vmstat(void)
> refresh_cpu_vm_stats(false);
> }
>
> +/*
> + * Synchronously quiet vmstat so the work is guaranteed not to run on return.
> + */
> +void quiet_vmstat_sync(void)
> +{
> + cpumask_set_cpu(smp_processor_id(), cpu_stat_off);
> + cancel_delayed_work_sync(this_cpu_ptr(&vmstat_work));
> + refresh_cpu_vm_stats(false);
> +}
>
> /*
> * Shepherd worker thread that checks the
> --
> 2.7.2
>
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists