Page MenuHomeFreeBSD

D26027.diff
No OneTemporary

D26027.diff

Index: head/sys/kern/kern_malloc.c
===================================================================
--- head/sys/kern/kern_malloc.c
+++ head/sys/kern/kern_malloc.c
@@ -618,6 +618,9 @@
unsigned long osize = size;
#endif
+ KASSERT((flags & M_WAITOK) == 0 || THREAD_CAN_SLEEP(),
+ ("malloc(M_WAITOK) in non-sleepable context"));
+
#ifdef MALLOC_DEBUG
va = NULL;
if (malloc_dbg(&va, &size, mtp, flags) != 0)
Index: head/sys/vm/uma_core.c
===================================================================
--- head/sys/vm/uma_core.c
+++ head/sys/vm/uma_core.c
@@ -3328,6 +3328,9 @@
uma_cache_bucket_t bucket;
uma_cache_t cache;
+ KASSERT((flags & M_WAITOK) == 0 || THREAD_CAN_SLEEP(),
+ ("uma_zalloc_smr(M_WAITOK) in non-sleepable context"));
+
#ifdef UMA_ZALLOC_DEBUG
void *item;
@@ -3351,6 +3354,9 @@
{
uma_cache_bucket_t bucket;
uma_cache_t cache;
+
+ KASSERT((flags & M_WAITOK) == 0 || THREAD_CAN_SLEEP(),
+ ("uma_zalloc(M_WAITOK) in non-sleepable context"));
/* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */
random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA);

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 13, 9:12 PM (16 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29636802
Default Alt Text
D26027.diff (1 KB)

Event Timeline