public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Tejun Heo <tj@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vladimir Davydov <vdavydov@parallels.com>,
	Jiri Kosina <jkosina@suse.cz>, Jeff Layton <jlayton@redhat.com>,
	Andreas Gruenbacher <agruen@linbit.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Jean Delvare <jdelvare@suse.de>,
	Monam Agarwal <monamagarwal123@gmail.com>
Subject: Re: [PATCH 3/4] ida: in-place ida allocation
Date: Wed, 23 Apr 2014 09:44:59 +0800	[thread overview]
Message-ID: <53571B1B.1060505@cn.fujitsu.com> (raw)
In-Reply-To: <20140422200221.GC2314@mtj.dyndns.org>

On 04/23/2014 04:02 AM, Tejun Heo wrote:
> On Tue, Apr 22, 2014 at 06:16:20PM +0800, Lai Jiangshan wrote:
>> There are two stages of ida allocation/free, idr_layers and ida_bitmap.
>> They add unneeded foot print and memory waste.
>>
>> When a single ID is first allocated from an ida, this ida requires
>> two big chunks of memory. One idr_layer and one ida_bitmap.
>>
>> To reduce the foot print and memory, we reduce the ida_bitmap
>> to a single "unsigned long" and place it in its own idr-slot
>> and avoid to allocate the ida_bitmap.
>>
>> It also means ida bitmap is located on its coresponding idr-slot
>> which size is the same as "unsigned long".
>> Each ida bitmap(idr-slot) contains BITS_PER_LONG ida-slots.
>>
>> The struct ida_bitmap is not needed any more, we use "unsigned long"
>> directly and remove all the code of alloc/free struct ida_bitmap.
> 
> Are you calling 128 byte a "big chunk of memory" while trading off
> tree depth for it?  No, this level of space optimizaiton is completely
> uncalled for.

I reduce the depth, you forgot that struct ida_bitmap is an additional
depth which is removed in the patch.

> 
>  Nacked-by: Tejun Heo <tj@kernel.org>
> 
> Thanks.
> 


  reply	other threads:[~2014-04-23  1:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 10:16 [PATCH 0/4] idr: idr cleanups Lai Jiangshan
2014-04-22 10:16 ` [PATCH 1/4] idr: proper invalid argument handling Lai Jiangshan
2014-04-22 19:16   ` Andrew Morton
2014-04-22 19:46     ` Andrew Morton
2014-04-22 19:54   ` Tejun Heo
2014-04-22 10:16 ` [PATCH 2/4] idr: reduce the number of MAX_IDR_FREE Lai Jiangshan
2014-04-22 19:58   ` Tejun Heo
2014-04-23  1:55     ` Lai Jiangshan
2014-04-22 10:16 ` [PATCH 3/4] ida: in-place ida allocation Lai Jiangshan
2014-04-22 20:02   ` Tejun Heo
2014-04-23  1:44     ` Lai Jiangshan [this message]
2014-04-22 10:16 ` [PATCH 4/4] idr: reorder the fields Lai Jiangshan

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=53571B1B.1060505@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    --cc=agruen@linbit.com \
    --cc=akpm@linux-foundation.org \
    --cc=jdelvare@suse.de \
    --cc=jkosina@suse.cz \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monamagarwal123@gmail.com \
    --cc=stephen@networkplumber.org \
    --cc=tj@kernel.org \
    --cc=vdavydov@parallels.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