lkml.org 
[lkml]   [2023]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/5] mm: compaction: refactor __compaction_suitable()
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@cmpxchg.org>
>
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
>
> 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@cmpxchg.org>
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@cmpxchg.org>
---
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
\
 
 \ /
  Last update: 2023-06-02 16:50    [W:0.046 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site