Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396585

Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage()

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage()
Date 2016-05-09 07:10 +0200
Message-ID <rwLCa-5YS-5@gated-at.bofh.it> (permalink)
References (1 earlier) <rvooj-6rF-25@gated-at.bofh.it> <rvEjn-5fk-1@gated-at.bofh.it> <rvFyN-6He-7@gated-at.bofh.it> <rvJVM-2eU-33@gated-at.bofh.it> <rvKoO-2rP-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, May 06, 2016 at 06:33:42PM +0900, Sergey Senozhatsky wrote:
> 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().

Why not if such simple improves zsmalloc? :)
Please send a patch.

Thanks a lot, Sergey!

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage() Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-05-05 07:30 +0200
  Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in  get_pages_per_zspage() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-05-05 12:10 +0200
    Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in  get_pages_per_zspage() Minchan Kim <minchan@kernel.org> - 2016-05-06 05:10 +0200
      Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage() Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-05-06 06:30 +0200
        Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in  get_pages_per_zspage() Minchan Kim <minchan@kernel.org> - 2016-05-06 06:40 +0200
        Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in  get_pages_per_zspage() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-05-06 11:10 +0200
          Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in  get_pages_per_zspage() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-05-06 11:40 +0200
            Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in  get_pages_per_zspage() Minchan Kim <minchan@kernel.org> - 2016-05-09 07:10 +0200
              Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in  get_pages_per_zspage() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-05-11 11:40 +0200

csiph-web