Re: [PATCH] vm_swappiness=0 should still try to avoid swapping anon memory

From: Nico Pache
Date: Mon Aug 09 2021 - 18:31:31 EST



> First, the shrink_list() will not be called for anon LRU if get_scan_count()
> has decided to not scan the anon LRU.

get_scan_count() will decide to scan the anon LRU if(sc->is_file_tiny) which is set in shrink_node().

 In shrink_node() the MAY_DEACTIVATE/DEACTIVATE_ANON allows this the be activated.

> Second, I would like to get your attention to the following comment in
> get_scan_count():
>
> "Global reclaim will swap to prevent OOM even with no swappiness"

AFAIK my patchset doesn't prevent any of the OOM cases. It only prevents the anon workingset refaults

from challenging the anon if swappiness=0. 

> It seems like the behavior you are seeing is actually working as intended.
> You may decide to change that behavior but you will need to motivate the
> change.

My V3 has a lot more in the commit log. Hopefully it will clear up my motivation. I will post that now.