Re: [PATCH v2 3/5] drm/ttm: Introduce ttm_bo_shrink_kswap_fragmented()

Andi Shyti
2026-04-28T10:07:13Z

Hi Matt,

...

> +/**
> + * ttm_bo_shrink_kswap_fragmented() - Whether in kswap and memory appears
> + * fragmented
> + * @nid: current node being shrunk
> + *
> + * Return: true if in kswap and memory appears fragmented, false is not.
> + */
> +bool ttm_bo_shrink_kswap_fragmented(int nid)

This name is a bit to strong and misleading, in my opinion.

> +{
> + enum zone_type zone_type;
> +
> + if (!current_is_kswapd())
> + return false;
> +
> + if (!numa_valid_node(nid))
> + return false;
> +
> +#if IS_ENABLED(CONFIG_ZONE_DMA32)
> + zone_type = ZONE_DMA32;
> +#else
> + zone_type = ZONE_NORMAL;
> +#endif
> +
> + for (; zone_type <= ZONE_NORMAL; ++zone_type) {

just start with "for (zone_type = 0; ... )" and you don't need
the ifdefs above.

Andi

> + struct zone *zone = &NODE_DATA(nid)->node_zones[zone_type];