Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177430172
D830.1794359985.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D830.1794359985.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
Wed, Nov 11, 1:19 AM (20 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41652025
Default Alt Text
D830.1794359985.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