On Fri, Feb 22, 2013 at 02:51:30PM -0800, Tejun Heo wrote: > Non-process context doesn't dip into preload pool, so the first > allocation after idr_preload() is *guaranteed* to fail iff the > previous idr_preload(GFP_KERNEL) failed and there just isn't much we > can do other than failing if GFP_KERNEL allocation fails.
If it still is confusing, a good way to think about it is that idr_preload() upgrades the immediately following idr_preload() allocation flag to the stronger of the two used in idr_preload() and idr_alloc(). In practice, this means there's no reason to use anything other than GFP_NOWAIT inside preloaded section. IMO, this is a better or rather more evolved design of preloading in radix_tree. It's a lot more convenient and I'm thinking about updating radix_tree preloading to about the same scheme. It's a bit cumbersome at the moment requiring determination of whether preloading will be used or not at initialization time. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
