Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147680917
D26027.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26027.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D26027: Catch illegal M_WAITOK immediately.
Attached
Detach File
Event Timeline
Log In to Comment