Re: [PATCH v2 3/3] mm: don't account memmap per node

From: Muchun Song
Date: Wed Aug 07 2024 - 22:59:55 EST




> On Aug 8, 2024, at 05:19, Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> wrote:
>
> Currently, when memory is hot-plugged or hot-removed the accounting is
> done based on the assumption that memmap is allocated from the same node
> as the hot-plugged/hot-removed memory, which is not always the case.
>
> In addition, there are challenges with keeping the node id of the memory
> that is being remove to the time when memmap accounting is actually
> performed: since this is done after remove_pfn_range_from_zone(), and
> also after remove_memory_block_devices(). Meaning that we cannot use
> pgdat nor walking though memblocks to get the nid.
>
> Given all of that, account the memmap overhead system wide instead.

Hi Pasha,

You've changed it to vm event mechanism. But I found a comment (below) say
"Counters should only be incremented". I do not know why it has such a rule
sice 2006. Now the rule should be changed, is there any effect to users of
/proc/vmstat?

/*
* Light weight per cpu counter implementation.
*
* Counters should only be incremented and no critical kernel component
* should rely on the counter values.
*
* Counters are handled completely inline. On many platforms the code
* generated will simply be the increment of a global address.
*/

Muchun,
Thanks.