[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210423083208.GB4239@techsingularity.net>
Date: Fri, 23 Apr 2021 09:32:08 +0100
From: Mel Gorman <mgorman@...hsingularity.net>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Chuck Lever <chuck.lever@...cle.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Michal Hocko <mhocko@...nel.org>,
Linux-MM <linux-mm@...ck.org>,
Linux-RT-Users <linux-rt-users@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [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
Powered by blists - more mailing lists