Messages in this thread Patch in this message | | | From | Ganesh Mahendran <> | Subject | [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage() | Date | Thu, 5 May 2016 13:17:27 +0800 |
| |
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
| |