Re: [PATCH] mm/vmpressure: remove window size TODO

From: Andrew Morton

Date: Mon Aug 31 2026 - 20:11:03 EST


On Mon, 31 Aug 2026 14:42:11 +0100 "Lorenzo Stoakes (ARM)" <ljs@xxxxxxxxxx> wrote:

> There has been a steady stream of patches that have been submitted by
> newcomers to core mm 'fixing' this TODO, with all but the original having
> very likely been generated by LLMs.
>
> It appears that TODOs to LLMs are like red rags to a bull.
>
> In addition, TODOs in code often bitrot and are distracting - those who
> understand the code know what could be improved in future.
>
> Therefore remove the TODO.
>
> The work required to actually fix this TODO requires somebody who both has
> understanding of the code and significant real-world data to back their
> changes.
>
> Such a person doesn't require a TODO prompt to implement this change, so
> nothing of value is being lost here.
>
> ...
>
> --- a/mm/vmpressure.c
> +++ b/mm/vmpressure.c
> @@ -30,9 +30,6 @@
> *
> * As the vmscan reclaimer logic works with chunks which are multiple of
> * SWAP_CLUSTER_MAX, it makes sense to use it for the window size as well.
> - *
> - * TODO: Make the window size depend on machine size, as we do for vmstat
> - * thresholds. Currently we set it to 512 pages (2MB for 4KB pages).
> */
> const unsigned long vmpressure_win = SWAP_CLUSTER_MAX * 16;

otoh, we could enhance the TODO to explain these considerations. This
might result in the LLM warriors submitting more usable work.

It would be a strange place to socialize these things but as you said,
red rags.