[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 5 May 2016 19:03:29 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Ganesh Mahendran <opensource.ganesh@...il.com>
Cc: minchan@...nel.org, ngupta@...are.org,
sergey.senozhatsky.work@...il.com, akpm@...ux-foundation.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in
get_pages_per_zspage()
On (05/05/16 13:17), Ganesh Mahendran wrote:
> if we find a zspage with usage == 100%, there is no need to
> try other zspages.
Hello,
well... we iterate there from 0 to 1<<2, which is not awfully
a lot to break it in the middle, and we do this only when we
initialize a new pool (for every size class).
the check is
- true 15 times
- false 492 times
so it _sort of_ feels like this new if-condition doesn't
buy us a lot, and most of the time it just sits there with
no particular gain. let's hear from Minchan.
-ss
> Signed-off-by: Ganesh Mahendran <opensource.ganesh@...il.com>
> Cc: Minchan Kim <minchan@...nel.org>
> Cc: Nitin Gupta <ngupta@...are.org>
> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.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
>
Powered by blists - more mailing lists