linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Nitin Gupta <nitingupta910@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 3/6] compcache: TLSF Allocator interface
Date: Mon, 24 Mar 2008 19:56:53 +0100	[thread overview]
Message-ID: <1206385013.6437.140.camel@lappy> (raw)
In-Reply-To: <4cefeab80803241034m6f62c01fq669129db9959f47f@mail.gmail.com>

On Mon, 2008-03-24 at 23:04 +0530, Nitin Gupta wrote:
> On Mon, Mar 24, 2008 at 10:26 PM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > On Mon, 2008-03-24 at 20:34 +0530, Nitin Gupta wrote:
> >  > Two Level Segregate Fit (TLSF) Allocator is used to allocate memory for
> >  > variable size compressed pages. Its fast and gives low fragmentation.
> >  > Following links give details on this allocator:
> >  >  - http://rtportal.upv.es/rtmalloc/files/tlsf_paper_spe_2007.pdf
> >  >  - http://code.google.com/p/compcache/wiki/TLSFAllocator
> >  >
> >  > This kernel port of TLSF (v2.3.2) introduces several changes but underlying
> >  > algorithm remains the same.
> >  >
> >  > Changelog TLSF v2.3.2 vs this kernel port
> >  >  - Pool now dynamically expands/shrinks.
> >  >    It is collection of contiguous memory regions.
> >  >  - Changes to pool create interface as a result of above change.
> >  >  - Collect and export stats (/proc/tlsfinfo)
> >  >  - Cleanups: kernel coding style, added comments, macros -> static inline, etc.
> >
> >  Can you explain why you need this allocator, why don't the current
> >  kernel allocators work for you?
> >
> >
> 
> kmalloc() allocates one of pre-defined sizes (as defined in
> kmalloc_sizes.h). This will surely cause severe fragmentation with
> these variable sized compressed pages.
> 
> Whereas, TLSF maintains very fine grained size lists. In all the
> workloads I tested, it showed <5% fragmentation. Also, its very simple
> as just ~700 LOC.

Yeah, it also suffers from a horrible coding style, can use excessive
amounts of vmalloc space, isn't hooked into the reclaim process as an
allocator should be and has a severe lack of per-cpu data making it a
pretty big bottleneck on anything with more than a few cores.

Now, it might be needed, might work better, and the scalability issue
might not be a problem when used for swap, but still, you don't treat
any of these points in your changelog.

FWIW, please split up the patches in a sane way. This series looks like
it wants to be 2 or 3 patches. The first introducing all of TLSF (this
split per file is horrible). The second doing all of the block device,
and a possible last doing documentation and such.

Also, how bad was kmalloc() compared to this TLSF, we need numbers :-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-03-24 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 15:04 Nitin Gupta
2008-03-24 16:56 ` Peter Zijlstra
2008-03-24 17:34   ` Nitin Gupta
2008-03-24 18:56     ` Peter Zijlstra [this message]
2008-03-24 19:10       ` Nitin Gupta
2008-04-03 17:23       ` Nitin Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206385013.6437.140.camel@lappy \
    --to=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nitingupta910@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox