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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!

---
>From abaf21e8dc2a3ed2aa181e0c89403807e5cea67d Mon Sep 17 00:00:00 2001
From: Johannes Weiner <hannes@xxxxxxxxxxx>
Date: Fri, 2 Jun 2023 10:13:15 -0400
Subject: [PATCH] mm: compaction: refactor __compaction_suitable() fix

Vlastimil points out the function comment is stale now. Update it.

Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
---
 mm/compaction.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 8f61cfa87c49..0503cb59c1cb 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2238,7 +2238,6 @@ static enum compact_result __compaction_suitable(struct zone *zone, int order,
  * compaction_suitable: Is this suitable to run compaction on this zone now?
  * Returns
  *   COMPACT_SKIPPED  - If there are too few free pages for compaction
- *   COMPACT_SUCCESS  - If the allocation would succeed without compaction
  *   COMPACT_CONTINUE - If compaction should run now
  */
 enum compact_result compaction_suitable(struct zone *zone, int order,
-- 
2.40.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux