Messages in this thread | | | From | "Peter T. Breuer" <> | Subject | can kfree sleep? | Date | Sun, 21 Nov 2004 13:23:12 +0100 (CET) |
| |
Just a question: can kfree sleep?
I believe so, but slab.c does not enlighten me immediately:
void kfree (const void *objp) { kmem_cache_t *c; unsigned long flags;
if (!objp) return; local_irq_save (flags); c = GET_PAGE_CACHE (virt_to_page (objp)); __cache_free (c, (void *) objp); local_irq_restore (flags); }
static inline void __cache_free (kmem_cache_t *cachep, void* objp) { struct array_cache *ac = ac_data(cachep);
check_irq_off(); objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
if (likely(ac->avail < ac->limit)) { STATS_INC_FREEHIT(cachep); ac_entry(ac)[ac->avail++] = objp; return; } else { STATS_INC_FREEMISS(cachep); cache_flusharray(cachep, ac); ac_entry(ac)[ac->avail++] = objp; } }
...
Peter - 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/
| |