[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221024161213.3221725-6-senozhatsky@chromium.org>
Date: Tue, 25 Oct 2022 01:12:12 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
Minchan Kim <minchan@...nel.org>
Cc: Nitin Gupta <ngupta@...are.org>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: [PATCH 5/6] zsmalloc: break out of loop when found perfect zspage order
If we found zspage configuration that gives us perfect
100% used percentage (zero wasted space) then there is
no point it trying any other configuration
Signed-off-by: Sergey Senozhatsky <senozhatsky@...omium.org>
---
mm/zsmalloc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index fa55e0c66f8d..40a09b1f63b5 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -790,6 +790,9 @@ static int get_pages_per_zspage(struct zs_pool *pool, int class_size)
max_usedpc = usedpc;
max_usedpc_order = i;
}
+
+ if (usedpc == 100)
+ break;
}
return max_usedpc_order;
--
2.38.0.135.g90850a2211-goog
Powered by blists - more mailing lists