From: Eric Dumazet <dada1@cosmosbay.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
Paul Menage <menage@google.com>,
kamezawa.hiroyu@jp.fujitsu.com,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Jens Axboe <jens.axboe@oracle.com>,
"David S. Miller" <davem@davemloft.net>, Jan Kara <jack@suse.cz>,
Jes Sorensen <jes@sgi.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/7] mm: introduce simple_malloc()/simple_free()
Date: Sun, 16 Nov 2008 07:08:37 +0100 [thread overview]
Message-ID: <491FB8E5.50806@cosmosbay.com> (raw)
In-Reply-To: <20081115215309.7f29c33c@infradead.org>
Arjan van de Ven a écrit :
> On Sun, 16 Nov 2008 13:35:03 +0800
> Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
>
>> vmalloc() is not good for performance and increasing fragment.
>> but vmalloc() is need for some subsystems' alternative malloc,
>> like cgroup's tasks file and other subsystems(about 20 subsystems).
>
> actually what you are pointing out is that these areas need improvement
> to not need such huge blocks of memory... but only a series of smaller
> blocks instead.
>
Just zap vmalloc()/vfree() then ?
More seriously, vmalloc()/vfree() were designed partly to make people life easier,
not to be *the* premium interface to manage kernel memory
Some parts of the kernel cannot afford the cost of vmalloc()/vfree(), so people
must think and design complex algos.
I personnaly like this cleanup too. For example bnx2 driver actually uses vmalloc() while
a kmalloc() should be OK for bnx2_alloc_rx_mem()
# grep bnx2 /proc/vmallocinfo
0xf8260000-0xf8274000 81920 bnx2_init_board+0x104/0xae0 phys=f6000000 ioremap
0xf8280000-0xf8294000 81920 bnx2_init_board+0x104/0xae0 phys=fa000000 ioremap
0xf82c1000-0xf82c3000 8192 bnx2_alloc_rx_mem+0x33/0x310 pages=1 vmalloc
0xf82d9000-0xf82db000 8192 bnx2_alloc_rx_mem+0x33/0x310 pages=1 vmalloc
I have two comments :
1) Names should be not "simple" : That is misleading. "convenient" maybe, or "slow"...
2) Since vmalloc()/vfree() is potentially a very expensive operation, we should make
slow_malloc()/slow_free() or whatever name is chosen, uninlined. No need to try to save
3 or 4 cpu cycles. This will save icache at least.
next prev parent reply other threads:[~2008-11-16 6:09 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-16 4:33 [PATCH 1/7] mm: introduce simple_malloc()/simple_free() Lai Jiangshan
2008-11-16 4:49 ` Alexey Dobriyan
2008-11-16 8:14 ` David Miller
2008-11-16 18:42 ` KOSAKI Motohiro
2008-11-16 4:52 ` Arjan van de Ven
2008-11-16 5:03 ` Andrew Morton
2008-11-16 5:35 ` Lai Jiangshan
2008-11-16 5:47 ` Andrew Morton
2008-11-16 5:53 ` Arjan van de Ven
2008-11-16 6:08 ` Eric Dumazet [this message]
2008-11-16 8:23 ` David Miller
2008-11-16 8:21 ` David Miller
2008-11-16 8:19 ` David Miller
2008-11-16 18:57 ` Arjan van de Ven
2008-11-16 21:39 ` Dave Airlie
2008-11-16 21:51 ` Arjan van de Ven
2008-11-16 22:42 ` Dave Airlie
2008-11-17 2:08 ` Lai Jiangshan
2008-11-17 4:53 ` Balbir Singh
2008-11-17 5:25 ` KAMEZAWA Hiroyuki
2008-11-17 6:43 ` KOSAKI Motohiro
2008-11-17 7:13 ` Andrew Morton
2008-11-17 7:15 ` David Miller
2008-11-17 8:10 ` KOSAKI Motohiro
2008-11-17 8:24 ` Balbir Singh
2008-11-18 4:39 ` Nick Piggin
2008-11-18 5:16 ` Lai Jiangshan
2008-11-17 4:46 ` Balbir Singh
2008-11-17 4:43 ` Balbir Singh
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=491FB8E5.50806@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=jack@suse.cz \
--cc=jens.axboe@oracle.com \
--cc=jes@sgi.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.