lkml.org 
[lkml]   [2016]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage()
On (05/06/16 18:08), Sergey Senozhatsky wrote:
[..]
> and it's not 45 iterations that we are getting rid of, but around 31:
> not every class reaches it's ideal 100% ratio on the first iteration.
> so, no, sorry, I don't think the patch really does what we want.


to be clear, what I meant was:

495 `cmp' + 15 `cmp je' IN
31 `mov cltd idiv mov sub imul cltd idiv cmp' OUT

IN > OUT.


CORRECTION here:

> * by the way, we don't even need `cltd' in those calculations. the
> reason why gcc puts cltd is because ZS_MAX_PAGES_PER_ZSPAGE has the
> 'wrong' data type. the patch to correct it is below (not a formal
> patch).

no, we need cltd there. but ZS_MAX_PAGES_PER_ZSPAGE also affects
ZS_MIN_ALLOC_SIZE, which is used in several places, like
get_size_class_index(). that's why ZS_MAX_PAGES_PER_ZSPAGE data
type change `improves' zs_malloc().

-ss

\
 
 \ /
  Last update: 2016-05-06 12:01    [W:0.077 / U:2.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site