Module Name:    src
Committed By:   chs
Date:           Tue Oct  1 17:40:22 UTC 2019

Modified Files:
        src/sys/uvm: uvm_pdaemon.c

Log Message:
in uvm_wait(), panic if the pagedaemon thread does not exist.
this avoids a hang if the system runs out of memory before
the mechanisms for reclaiming memory have been set up.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/uvm/uvm_pdaemon.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_pdaemon.c
diff -u src/sys/uvm/uvm_pdaemon.c:1.110 src/sys/uvm/uvm_pdaemon.c:1.111
--- src/sys/uvm/uvm_pdaemon.c:1.110	Sun Apr 21 15:32:18 2019
+++ src/sys/uvm/uvm_pdaemon.c	Tue Oct  1 17:40:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.c,v 1.110 2019/04/21 15:32:18 chs Exp $	*/
+/*	$NetBSD: uvm_pdaemon.c,v 1.111 2019/10/01 17:40:22 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.110 2019/04/21 15:32:18 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.111 2019/10/01 17:40:22 chs Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -133,6 +133,9 @@ uvm_wait(const char *wmsg)
 {
 	int timo = 0;
 
+	if (uvm.pagedaemon_lwp == NULL)
+		panic("out of memory before the pagedaemon thread exists");
+
 	mutex_spin_enter(&uvm_fpageqlock);
 
 	/*

Reply via email to