Re: [PATCH 3/5] mm: compaction: refactor __compaction_suitable()

From: Johannes Weiner
Date: Fri Jun 02 2023 - 10:49:57 EST


On Mon, May 29, 2023 at 07:11:35PM +0200, Vlastimil Babka wrote:
> On 5/19/23 14:39, Johannes Weiner wrote:
> > __compaction_suitable() is supposed to check for available migration
> > targets. However, it also checks whether the operation was requested
> > via /proc/sys/vm/compact_memory, and whether the original allocation
> > request can already succeed. These don't apply to all callsites.
> >
> > Move the checks out to the callers, so that later patches can deal
> > with them one by one. No functional change intended.
> >
> > Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
>
> Acked-by: Vlastimil Babka <vbabka@xxxxxxx>
>
> Note comment on compaction_suitable() still mentions COMPACT_SUCCESS, that
> is no longer possible, so delete that line?

Good catch, let's remove it.

> Also on closer look, both compaction_suitable() and __compaction_suitable()
> could now simply return bool. The callers use it that way anyway. There
> would just be some extra fiddling internally aroud the tracepoint.

Also a great idea. This will raise conflicts in later changes, so I'll
send a new patch to go on top of the stack.

Andrew, can you please fold this? Thanks!

---