Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm in uvm_wait(), panic if the pagedaemon thread does n...



details:   https://anonhg.NetBSD.org/src/rev/bcdb204dd548
branches:  trunk
changeset: 459918:bcdb204dd548
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Oct 01 17:40:22 2019 +0000

description:
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.

diffstat:

 sys/uvm/uvm_pdaemon.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 90978a109238 -r bcdb204dd548 sys/uvm/uvm_pdaemon.c
--- a/sys/uvm/uvm_pdaemon.c     Tue Oct 01 17:35:09 2019 +0000
+++ b/sys/uvm/uvm_pdaemon.c     Tue Oct 01 17:40:22 2019 +0000
@@ -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 @@
 {
        int timo = 0;
 
+       if (uvm.pagedaemon_lwp == NULL)
+               panic("out of memory before the pagedaemon thread exists");
+
        mutex_spin_enter(&uvm_fpageqlock);
 
        /*



Home | Main Index | Thread Index | Old Index