Re: [PATCH v7 4/7] mm: pghot: Precision mode for pghot

Donet Tom
2026-05-04T18:42:16Z

Hi Bharata

On 5/4/26 11:39 AM, Bharata B Rao wrote:
> +#include <linux/pghot.h>
> +#include <linux/jiffies.h>
> +#include <linux/memory-tiers.h>
> +
> +bool pghot_nid_valid(int nid)

I might be missing something, but since pghot_nid_valid() exists in both
pghot-default.c and pghot-precise.c, would it make sense to move it to a
header file as a static inline function?

-Donet

> +{
> + if (nid != NUMA_NO_NODE &&
> + (!numa_valid_node(nid) || nid > PGHOT_NID_MAX ||
> + !node_online(nid) || !node_is_toptier(nid)))
> + return false;
> +
> + return true;
> +}
> +
> +unsigned long pghot_access_latency(unsigned long old_time, unsigned long time)
> +{
> + return jiffies_to_msecs((time - old_time) & PGHOT_TIME_MASK);
> +}
> +
> +bool pghot_update_record(phi_t *phi, int nid, unsigned long now)
> +{