lkml.org 
[lkml]   [2012]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/5] vmstat: Implement refresh_vm_stats()
On Fri, 1 Jun 2012, Anton Vorontsov wrote:

> This function forcibly flushes per-cpu vmstat diff counters to the
> global counters.

Why is it necessary to have a function that does not expire the pcps? Is
that side effect important? We use refresh_vm_cpu_stats(cpu) in
page_alloc.c already to flush the vmstat counters. Is the flushing of the
pcps in 2 seconds insteads of 3 once really that important?

Also if we do this

Can we therefore also name the function in a different way like

flush_vmstats()


> @@ -456,11 +457,15 @@ void refresh_cpu_vm_stats(int cpu)
> local_irq_restore(flags);
> atomic_long_add(v, &zone->vm_stat[i]);
> global_diff[i] += v;
> + if (!drain_pcp)
> + continue;
> #ifdef CONFIG_NUMA
> /* 3 seconds idle till flush */
> p->expire = 3;
> #endif

Erm. This should be

#ifdef CONFIG_NUMA
if (drain_pcp)
p->expire = 3;
#endif

The construct using "continue" is weird.


> }
> + if (!drain_pcp)
> + continue;
> cond_resched();
> #ifdef CONFIG_NUMA
> /*
> @@ -495,6 +500,21 @@ void refresh_cpu_vm_stats(int cpu)
> atomic_long_add(global_diff[i], &vm_stat[i]);
> }
>
> +void refresh_cpu_vm_stats(int cpu)
> +{
> + __refresh_cpu_vm_stats(cpu, 1);
> +}

Fold __refresh_cpu_vm_stats into this function and modify the caller
of refresh_cpu_vm_stats instead.



\
 
 \ /
  Last update: 2012-06-05 17:41    [W:0.409 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site