Re: [RFC][PATCH 11/13] mm/vmscan: Consider anonymous pages without swap

From: Dave Hansen
Date: Tue Feb 02 2021 - 16:36:42 EST


On 2/2/21 10:56 AM, Yang Shi wrote:
>>
>> /* If we have no swap space, do not bother scanning anon pages. */
>> - if (!sc->may_swap || mem_cgroup_get_nr_swap_pages(memcg) <= 0) {
>> + if (!sc->may_swap || !can_reclaim_anon_pages(memcg, pgdat->node_id)) {
> Just one minor thing about may_swap. It may be cleared by
> nr_boost_reclaim. But demotion should be fine for boost_reclaim.

In other words, this if() is here is to avoid generating suboptimal I/O
during boost_reclaim. But, since demotion doesn't generate any I/O, it
*should* be fine for boost_reclaim.

I agree with that in theory. Although, I'm tempted to put it in the
TODO list as something to look at in the future. Do you think it's
something that's immediately necessary?