Re: [PATCH] mm, proc: collect percpu free pages into the free pages

From: mawupeng
Date: Wed Sep 04 2024 - 02:49:37 EST




On 2024/9/3 16:09, Michal Hocko wrote:
> On Tue 03-09-24 09:50:48, mawupeng wrote:
>>> Drain remote PCP may be not that expensive now after commit 4b23a68f9536
>>> ("mm/page_alloc: protect PCP lists with a spinlock"). No IPI is needed
>>> to drain the remote PCP.
>>
>> This looks really great, we can think a way to drop pcp before goto slowpath
>> before swap.
>
> We currently drain after first unsuccessful direct reclaim run. Is that
> insufficient?

The reason i said the drain of pcp is insufficient or expensive is based
on you comment[1] :-). Since IPIs is not requiered since commit 4b23a68f9536
("mm/page_alloc: protect PCP lists with a spinlock"). This could be much
better.

[1]: https://lore.kernel.org/linux-mm/ZWRYZmulV0B-Jv3k@tiehlicka/

> Should we do a less aggressive draining sooner? Ideally
> restricted to cpus on the same NUMA node maybe? Do you have any specific
> workloads that would benefit from this?

Current the problem is amount the pcp, which can increase to 4.6%(24644M)
of the total 512G memory.