Message ID | 20130828211217.GE1357@kmo-pixel (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, 28 Aug 2013 14:12:17 -0700 Kent Overstreet <kmo@daterainc.com> wrote: > How's this look? > > diff --git a/lib/idr.c b/lib/idr.c > index 15c021c..a3f8e9a 100644 > --- a/lib/idr.c > +++ b/lib/idr.c > @@ -1288,6 +1288,11 @@ static inline unsigned alloc_local_tag(struct percpu_ida *pool, > * Safe to be called from interrupt context (assuming it isn't passed > * __GFP_WAIT, of course). > * > + * @gfp indicates whether or not to wait until a free id is available (it's not > + * used for internal memory allocations); thus if passed __GFP_WAIT we may sleep > + * however long it takes until another thread frees an id (same semantics as a > + * mempool). Looks good. Mentioning the mempool thing is effective - people understand that. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/lib/idr.c b/lib/idr.c index 15c021c..a3f8e9a 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -1288,6 +1288,11 @@ static inline unsigned alloc_local_tag(struct percpu_ida *pool, * Safe to be called from interrupt context (assuming it isn't passed * __GFP_WAIT, of course). * + * @gfp indicates whether or not to wait until a free id is available (it's not + * used for internal memory allocations); thus if passed __GFP_WAIT we may sleep + * however long it takes until another thread frees an id (same semantics as a + * mempool). + * * Will not fail if passed __GFP_WAIT. */ int percpu_ida_alloc(struct percpu_ida *pool, gfp_t gfp)