[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93b293341866a4366b2f2a614f8742ca94ff4e3c.camel@linux.intel.com>
Date: Mon, 20 Mar 2023 13:43:09 -0700
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: Marcelo Tosatti <mtosatti@...hat.com>,
Christoph Lameter <cl@...ux.com>
Cc: Aaron Tomlin <atomlin@...mlin.com>,
Frederic Weisbecker <frederic@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Russell King <linux@...linux.org.uk>,
Huacai Chen <chenhuacai@...nel.org>,
Heiko Carstens <hca@...ux.ibm.com>, x86@...nel.org,
Vlastimil Babka <vbabka@...e.cz>,
Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH v7 13/13] vmstat: add pcp remote node draining via
cpu_vm_stats_fold
On Mon, 2023-03-20 at 15:03 -0300, Marcelo Tosatti wrote:
>
> +
> + if (do_pagesets) {
> + cond_resched();
> + /*
> + * Deal with draining the remote pageset of a
> + * processor
> + *
> + * Check if there are pages remaining in this pageset
> + * if not then there is nothing to expire.
> + */
> + if (!pcp->expire || !pcp->count)
> + continue;refresh_cpu_vm_stats
> +
> + /*
> + * We never drain zones local to this processor.
> + */
> + if (zone_to_nid(zone) == cpu_to_node(cpu)) {
> + pcp->expire = 0;
> + continue;
> + }
> +
> + WARN_ON(pcp->expire < 0);
> + /*
> + * pcp->expire is only accessed from vmstat_shepherd context,
> + * therefore no locking is required.
> + */
> + if (--pcp->expire)
> + continue;
> +
> + if (pcp->count)
> + drain_zone_pages(zone, pcp);
> + }
This logic is the same to that for the do_pagesets portion of code in refresh_cpu_vm_stats().
Is it possible to consolidate to avoid replicating the logic across two functions?
Tim
Powered by blists - more mailing lists