From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004@gmx.net>
Cc: Robert Love <rml@novell.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] [PATCH] kmem_alloc (generic wrapper for kmalloc and vmalloc)
Date: Wed, 10 Nov 2004 18:10:30 +1100 [thread overview]
Message-ID: <4191BEE6.8000900@yahoo.com.au> (raw)
In-Reply-To: <4191B5D8.3090700@gmx.net>
Carl-Daniel Hailfinger wrote:
> Robert Love schrieb:
>
>>On Wed, 2004-11-10 at 06:19 +0100, Carl-Daniel Hailfinger wrote:
>>
>>
>>>Hi,
>>>
>>>it seems there is a bunch of drivers which want to allocate memory as
>>>efficiently as possible in a wide range of allocation sizes. XFS and
>>>NTFS seem to be examples. Implement a generic wrapper to reduce code
>>>duplication.
>>>Functions have the my_ prefixes to avoid name clash with XFS.
>>
>>
>>No, no, no. A good patch would be fixing places where you see this.
>>
>>Code needs to conscientiously decide to use vmalloc over kmalloc. The
>>behavior is different and the choice needs to be explicit.
>
>
> Yes, but what do you suggest for the following problem:
> alloc(max_loop*sizeof(struct loop_device))
>
> where sizeof(struct loop_device)==304 and 1<=max_loop<=16384
>
> For the smallest allocation (304 bytes) vmalloc is clearly wasteful
> and for the largest allocation (~ 5 MBytes) kmalloc doesn't work.
>
Can't you change it to use a hash or something?
Even a linked list if it is not performance critical.
next prev parent reply other threads:[~2004-11-10 7:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-10 5:19 [RFC] [PATCH] kmem_alloc (generic wrapper for kmalloc and vmalloc) Carl-Daniel Hailfinger
2004-11-10 6:03 ` Robert Love
2004-11-10 6:31 ` Carl-Daniel Hailfinger
2004-11-10 6:57 ` Robert Love
2004-11-10 7:10 ` Nick Piggin [this message]
2004-11-10 13:36 ` Geert Uytterhoeven
2004-11-10 7:54 ` Jens Axboe
2004-11-10 17:03 ` Carl-Daniel Hailfinger
2004-11-10 17:17 ` Roland Dreier
2004-11-10 17:54 ` Adam Heath
2004-11-10 18:04 ` Jens Axboe
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=4191BEE6.8000900@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=c-d.hailfinger.kernel.2004@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@novell.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.