Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1320795 > unrolled thread
| Started by | Michal Hocko <mhocko@kernel.org> |
|---|---|
| First post | 2016-01-28 16:40 +0100 |
| Last post | 2016-01-28 17:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] mm, vmstat: make quiet_vmstat lighter (was: Re: fast path cycle muncher (vmstat: make vmstat_updater deferrable) again and shut down on idle) Michal Hocko <mhocko@kernel.org> - 2016-01-28 16:40 +0100
Re: [PATCH] mm, vmstat: make quiet_vmstat lighter (was: Re: fast path cycle muncher (vmstat: make vmstat_updater deferrable) again and shut down on idle) Christoph Lameter <cl@linux.com> - 2016-01-28 17:50 +0100
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Date | 2016-01-28 16:40 +0100 |
| Subject | Re: [PATCH] mm, vmstat: make quiet_vmstat lighter (was: Re: fast path cycle muncher (vmstat: make vmstat_updater deferrable) again and shut down on idle) |
| Message-ID | <qVWPU-5sX-19@gated-at.bofh.it> |
On Wed 27-01-16 12:26:16, Christoph Lameter wrote:
> On Wed, 27 Jan 2016, Michal Hocko wrote:
[...]
> > +void quiet_vmstat(void)
> > +{
> > + if (system_state != SYSTEM_RUNNING)
> > + return;
> > +
> > + /*
> > + * If we are already in hands of the shepherd then there
> > + * is nothing for us to do here.
> > + */
> > + if (cpumask_test_and_set_cpu(smp_processor_id(), cpu_stat_off))
> > + return;
> > +
> > + if (!need_update(smp_processor_id()))
> > + return;
> > +
> > + /*
> > + * Just refresh counters and do not care about the pending delayed
> > + * vmstat_update. It doesn't fire that often to matter and canceling
> > + * it would be too expensive from this path.
> > + * vmstat_shepherd will take care about that for us.
> > + */
> > + refresh_cpu_vm_stats(false);
> > +}
>
> The problem here is that there will be an additional tick generated on
> idle. This is an issue for power because now the processor has to
> needlessly wake up again, do tick processing etc just to effectively do a
> cancel_delayed_work().
Thinking about it some more, making vmstat_update deferrable should help
to not interrupt idle no?
---
diff --git a/mm/vmstat.c b/mm/vmstat.c
index eb30bf45bd55..69537d2be6f6 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1512,7 +1512,7 @@ static void __init start_shepherd_timer(void)
int cpu;
for_each_possible_cpu(cpu)
- INIT_DELAYED_WORK(per_cpu_ptr(&vmstat_work, cpu),
+ INIT_DEFERRABLE_WORK(per_cpu_ptr(&vmstat_work, cpu),
vmstat_update);
if (!alloc_cpumask_var(&cpu_stat_off, GFP_KERNEL))
--
Michal Hocko
SUSE Labs
[toc] | [next] | [standalone]
| From | Christoph Lameter <cl@linux.com> |
|---|---|
| Date | 2016-01-28 17:50 +0100 |
| Message-ID | <qVXVE-69J-29@gated-at.bofh.it> |
| In reply to | #1320795 |
On Thu, 28 Jan 2016, Michal Hocko wrote: > Thinking about it some more, making vmstat_update deferrable should help > to not interrupt idle no? It will align with the tick then. Yes indeed this should be done. > --- > diff --git a/mm/vmstat.c b/mm/vmstat.c > index eb30bf45bd55..69537d2be6f6 100644 > --- a/mm/vmstat.c > +++ b/mm/vmstat.c > @@ -1512,7 +1512,7 @@ static void __init start_shepherd_timer(void) > int cpu; > > for_each_possible_cpu(cpu) > - INIT_DELAYED_WORK(per_cpu_ptr(&vmstat_work, cpu), > + INIT_DEFERRABLE_WORK(per_cpu_ptr(&vmstat_work, cpu), > vmstat_update); > > if (!alloc_cpumask_var(&cpu_stat_off, GFP_KERNEL)) >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web