Re: [PATCH] mm, vmscan: make kswapd unreserve highatomic pageblocks

From: Vlastimil Babka (SUSE)

Date: Thu Nov 05 2026 - 03:02:38 EST


On 11/4/26 22:56, Jose A. Perez de Azpillaga wrote:
> On 11/4/26 7:38 PM, Vlastimil Babka (SUSE) wrote:
>> Hook this highatomic unreserve to the moment we are increasing kswapd
>> reclaim priority, as that is when kswapd is struggling to make progress
>> and it should roughly match the case of direct reclaim failure.
>>
>
> isn't raise_priority true after almost every pass at DEF_PRIORITY, stuck
> or not?

Can you elaborate why? At least at first glance, kswapd_shrink_node() should
return true if it scans the requested amount of pages. So I would assume
that although balance_pgdat() will do multiple iterations to reach high
watermarks (because every round of kswapd_shrink_node() will limit itself to
SWAP_CLUSTER_MAX per zone for sc->nr_to_reclaim) this should not be raising
priority if the rounds are successful?

> [snip]
>
>> + if (raise_priority || !nr_reclaimed) {
>> + /*
>> + * Similarly to when direct reclaim is retrying, try to
>> + * unreserve highatomic pageblocks on the node. Convert
>> + * them to movable ones as kswapd doesn't have a target
>> + * migratetype, and passing unmovable should lead to
>> + * least permanent fragmentation.
>> + */
>> + for (int i = 0; i <= highest_zoneidx; i++) {
>> + struct zone *zone = pgdat->node_zones + i;
>> +
>> + unreserve_highatomic_pageblock_zone(zone,
>> + MIGRATE_UNMOVABLE, false);
>> + }
> s/movable/unmovable/ in the comment?
>