lkml.org 
[lkml]   [2021]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/9] mm/vmstat: Convert NUMA statistics to basic NUMA counters
On Thu, Apr 22, 2021 at 05:18:38PM +0200, Vlastimil Babka wrote:
> > +
> > +#ifdef CONFIG_NUMA
> > +static void fold_vm_zone_numa_events(struct zone *zone)
> > {
> > - int i;
> > - int changes = 0;
> > + int zone_numa_events[NR_VM_NUMA_EVENT_ITEMS] = { 0, };
>
> Should this be long? pzstats are, the global counters too, so seems weird to use
> int as intermediate sum counter.
>

While overflow can happen eventually, unsigned long defers the problem
so yes, I'll make it unsigned long.

> > #ifdef CONFIG_NUMA
> > - for (i = 0; i < NR_VM_NUMA_STAT_ITEMS; i++)
> > - if (pzstats->vm_numa_stat_diff[i]) {
> > + for (i = 0; i < NR_VM_NUMA_EVENT_ITEMS; i++) {
> > + if (pzstats->vm_numa_event[i]) {
> > int v;
>
> Also long?
>

Same.

> > /*
> > @@ -939,43 +914,36 @@ void cpu_vm_stats_fold(int cpu)
> > */
> > void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *pzstats)
> > {
> > - int i;
> > + int i, v;
>
> And the 'v' here. Maybe keep using local to each loop below and make it long for
> the NUMA one?
>

I just made it unsigned long. There is no storage advantage to changing
type in a local scoped variable.

Thanks

--
Mel Gorman
SUSE Labs

\
 
 \ /
  Last update: 2021-04-23 10:32    [W:0.045 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site