From: Momchil Velikov <velco@fadata.bg>
To: arjanv@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: slab: avoid linear search in kmalloc? (GCC Guru wanted :)
Date: 21 Nov 2001 11:34:48 +0200 [thread overview]
Message-ID: <87wv0kv553.fsf@fadata.bg> (raw)
In-Reply-To: <20011121024525.A18750@lina.inka.de> <873d38wkmo.fsf@fadata.bg> <3BFB725C.7468088A@redhat.com>
In-Reply-To: <3BFB725C.7468088A@redhat.com>
>>>>> "Arjan" == Arjan van de Ven <arjanv@redhat.com> writes:
Arjan> Momchil Velikov wrote:
>>
>> >>>>> "Bernd" == Bernd Eckenfels <ecki@lina.inka.de> writes:
>>
Bernd> Hello,
Bernd> I noticed that kmalloc and kmem_find_general_cachep are doing a linear
Bernd> search in the cache_sizes array. Isnt it better to speed that up by doing a
Bernd> binary search or a b-tree if like the following patch?
>>
>> Here is a patch using a gcc extension. gcc generates binary search for the case.
Arjan> the big "case" statement makes you wonder if ffz(~size) would do the
Arjan> same ;)
*Nod*, espesially on architectures, where it is a single instruction.
OTOH, this is possible only if the sizes are powers of two. And they
could be more closely sparsed ...
Regards,
-velco
prev parent reply other threads:[~2001-11-21 10:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-21 1:45 slab: avoid linear search in kmalloc? (GCC Guru wanted :) Bernd Eckenfels
2001-11-21 2:03 ` Andrew Morton
2001-11-21 9:14 ` Momchil Velikov
2001-11-21 9:22 ` Arjan van de Ven
2001-11-21 9:34 ` Momchil Velikov [this message]
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=87wv0kv553.fsf@fadata.bg \
--to=velco@fadata.bg \
--cc=arjanv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/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.