Re: slab: avoid linear search in kmalloc? (GCC Guru wanted :)

From: Arjan van de Ven (arjanv@redhat.com)
Date: Wed Nov 21 2001 - 04:22:36 EST


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.

the big "case" statement makes you wonder if ffz(~size) would do the
same ;)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:26 EST