linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage()
@ 2016-05-05  5:17 Ganesh Mahendran
  2016-05-05 10:03 ` Sergey Senozhatsky
  0 siblings, 1 reply; 9+ messages in thread
From: Ganesh Mahendran @ 2016-05-05  5:17 UTC (permalink / raw)
  To: minchan, ngupta, sergey.senozhatsky.work, akpm
  Cc: linux-mm, linux-kernel, Ganesh Mahendran

if we find a zspage with usage == 100%, there is no need to
try other zspages.

Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
---
 mm/zsmalloc.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index fda7177..310c7b0 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -765,6 +765,9 @@ static int get_pages_per_zspage(int class_size)
 		if (usedpc > max_usedpc) {
 			max_usedpc = usedpc;
 			max_usedpc_order = i;
+
+			if (max_usedpc == 100)
+				break;
 		}
 	}
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-05-11  9:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-05  5:17 [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage() Ganesh Mahendran
2016-05-05 10:03 ` Sergey Senozhatsky
2016-05-06  3:09   ` Minchan Kim
2016-05-06  4:25     ` Ganesh Mahendran
2016-05-06  4:37       ` Minchan Kim
2016-05-06  9:08       ` Sergey Senozhatsky
2016-05-06  9:33         ` Sergey Senozhatsky
2016-05-09  5:01           ` Minchan Kim
2016-05-11  9:34             ` Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).