Re: [PATCH] unified device list allocator

From: Matt Mackall
Date: Tue Mar 08 2005 - 01:07:06 EST


On Mon, Mar 07, 2005 at 09:33:02PM -0800, Andrew Morton wrote:
> Matt Mackall <mpm@xxxxxxxxxxx> wrote:
> >
> > + /* search for insertion point in reverse for dynamic allocation */
> > + list_for_each_prev(l, list) {
>
> hrmph. Any time we do anything in O(n) time, some smarty comes along with
> a workload which blows us out of the water. Although it's hard to think of
> any register_blkdev()-intensive workloads.
>
> It's not possible to do this with prio-trees?

I thought about using rbtrees. But I decided it was overkill. Beyond
the 4k limit of the current proc code, currently that's limited to
~256 entries per block/char and will be limited to about ~1024 each
for the foreseeable future. It's only walked on driver init/exit and
when catting said proc file (where O(n) is unavoidable). In other
words, worst case we're talking less than a millisecond at
boot/shutdown.

--
Mathematics is the supreme nostalgia of our time.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/