Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157282851
D830.id1750.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
D830.id1750.diff
View Options
Index: sys/kern/kern_malloc.c
===================================================================
--- sys/kern/kern_malloc.c
+++ sys/kern/kern_malloc.c
@@ -472,9 +472,12 @@
}
}
#endif
- if (flags & M_WAITOK)
+ if (flags & M_WAITOK) {
KASSERT(curthread->td_intr_nesting_level == 0,
("malloc(M_WAITOK) in interrupt context"));
+ KASSERT_WARN(THREAD_CAN_SLEEP(),
+ ("malloc(M_WAITOK) in no_sleeping context"));
+ }
#ifdef DEBUG_MEMGUARD
if (memguard_cmp_mtp(mtp, size)) {
Index: sys/vm/uma_core.c
===================================================================
--- sys/vm/uma_core.c
+++ sys/vm/uma_core.c
@@ -2109,6 +2109,10 @@
if (flags & M_WAITOK) {
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
"uma_zalloc_arg: zone \"%s\"", zone->uz_name);
+ KASSERT_WARN(curthread->td_intr_nesting_level == 0,
+ ("uma_zalloc_arg(M_WAITOK) in interrupt context"));
+ KASSERT_WARN(THREAD_CAN_SLEEP(),
+ ("uma_zalloc_arg(M_WAITOK) in no_sleeping context"));
}
#ifdef DEBUG_MEMGUARD
if (memguard_cmp_zone(zone)) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 21, 12:12 AM (6 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33364779
Default Alt Text
D830.id1750.diff (1 KB)
Attached To
Mode
D830: Assert that malloc(9) and uma_zalloc_arg(9) are not called from non-sleepable threads or interrupts.
Attached
Detach File
Event Timeline
Log In to Comment