Page MenuHomeFreeBSD

D830.1794359562.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D830.1794359562.diff

Index: sys/kern/kern_malloc.c
===================================================================
--- sys/kern/kern_malloc.c
+++ sys/kern/kern_malloc.c
@@ -472,9 +472,11 @@
}
}
#endif
+ KASSERT(curthread->td_intr_nesting_level == 0,
+ ("malloc in interrupt context"));
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
@@ -2106,9 +2106,14 @@
CTR3(KTR_UMA, "uma_zalloc_arg thread %x zone %s flags %d", curthread,
zone->uz_name, flags);
+ KASSERT(curthread->td_intr_nesting_level == 0,
+ ("uma_zalloc_arg in interrupt context"));
+
if (flags & M_WAITOK) {
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
"uma_zalloc_arg: zone \"%s\"", zone->uz_name);
+ KASSERT_WARN(THREAD_CAN_SLEEP(),
+ ("uma_zalloc_arg(M_WAITOK) in no_sleeping context"));
}
#ifdef DEBUG_MEMGUARD
if (memguard_cmp_zone(zone)) {

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 11, 1:12 AM (14 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41651973
Default Alt Text
D830.1794359562.diff (1 KB)

Event Timeline