On Thu, 13 Jul 2006 18:18:35 -0700 Andrew Morton <[email protected]> wrote: > > Having the caller hold a chunk of memory in a stack variable was the > > trick I came up with to get around that. > > Yes, that certainly works. Problem is, I think, you'll need to preallocate IDR_FREE_MAX items. And then free them all again when none of them were consumed (usual). Yes, storing the preallocated nodes in the idr itself requires locking. But that locking is 100% private to the IDR implementation. It locks only the preload list and not the user's stuff. radix_tree_preload() effectively does this. Except the preload list is kernel-wide. It's split across CPUs and uses local_irq_disable/preempt_disable locking tricks as a performance optimisation. But conceptually it's the same. Simply copying that would give something which is known to work... It seems like a large amount of fuss, but when you think about it the problem isn't simple. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Roland Dreier <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- References:
- ipoib lockdep warning
- From: Zach Brown <[email protected]>
- Re: [openib-general] ipoib lockdep warning
- From: Roland Dreier <[email protected]>
- Re: [openib-general] ipoib lockdep warning
- From: Zach Brown <[email protected]>
- Re: [openib-general] ipoib lockdep warning
- From: Roland Dreier <[email protected]>
- Re: [openib-general] ipoib lockdep warning
- From: Ingo Molnar <[email protected]>
- [PATCH] Convert idr's internal locking to _irqsave variant
- From: Roland Dreier <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Roland Dreier <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Roland Dreier <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Roland Dreier <[email protected]>
- Re: [PATCH] Convert idr's internal locking to _irqsave variant
- From: Andrew Morton <[email protected]>
- ipoib lockdep warning
- Prev by Date: Re: [PATCH] Convert idr's internal locking to _irqsave variant
- Next by Date: Re: suspend/hibernate to work on thinkpad x60s?
- Previous by thread: Re: [PATCH] Convert idr's internal locking to _irqsave variant
- Next by thread: Re: [PATCH] Convert idr's internal locking to _irqsave variant
- Index(es):