-/* $OpenBSD: kern_malloc.c,v 1.132 2018/01/02 06:07:21 guenther Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.133 2018/01/18 18:08:51 bluhm Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/proc.h>
#include <sys/stdint.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
mtx_leave(&malloc_mtx);
return (NULL);
}
+#ifdef DIAGNOSTIC
+ if (ISSET(flags, M_WAITOK) && curproc == &proc0)
+ panic("%s: cannot sleep for memory during boot",
+ __func__);
+#endif
if (ksp->ks_limblocks < 65535)
ksp->ks_limblocks++;
msleep(ksp, &malloc_mtx, PSWP+2, memname[type], 0);
-/* $OpenBSD: subr_pool.c,v 1.220 2017/08/13 20:26:33 guenther Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.221 2018/01/18 18:08:51 bluhm Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/pool.h>
+#include <sys/proc.h>
#include <sys/syslog.h>
#include <sys/sysctl.h>
#include <sys/task.h>
struct pool_get_memory mem = { .v = NULL };
struct pool_request pr;
+#ifdef DIAGNOSTIC
+ if (ISSET(flags, PR_WAITOK) && curproc == &proc0)
+ panic("%s: cannot sleep for memory during boot",
+ __func__);
+#endif
pl_init(pp, &mem.lock);
pool_request_init(&pr, pool_get_done, &mem);
pool_request(pp, &pr);
-/* $OpenBSD: uvm_pdaemon.c,v 1.78 2017/02/14 10:31:15 mpi Exp $ */
+/* $OpenBSD: uvm_pdaemon.c,v 1.79 2018/01/18 18:08:51 bluhm Exp $ */
/* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */
/*
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/pool.h>
+#include <sys/proc.h>
#include <sys/buf.h>
#include <sys/mount.h>
#include <sys/atomic.h>
{
int timo = 0;
+#ifdef DIAGNOSTIC
+ if (curproc == &proc0)
+ panic("%s: cannot sleep for memory during boot", __func__);
+#endif
+
/* check for page daemon going to sleep (waiting for itself) */
if (curproc == uvm.pagedaemon_proc) {
printf("uvm_wait emergency bufbackoff\n");