Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_pglistalloc() / uvm_pglistfree() musn't be calle...



details:   https://anonhg.NetBSD.org/src/rev/a9a0d3add495
branches:  trunk
changeset: 969802:a9a0d3add495
user:      ad <ad%NetBSD.org@localhost>
date:      Sun Mar 01 21:43:56 2020 +0000

description:
uvm_pglistalloc() / uvm_pglistfree() musn't be called from interrupt
context.  Assert it.

diffstat:

 sys/uvm/uvm_pglist.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r c7fb16919154 -r a9a0d3add495 sys/uvm/uvm_pglist.c
--- a/sys/uvm/uvm_pglist.c      Sun Mar 01 21:42:58 2020 +0000
+++ b/sys/uvm/uvm_pglist.c      Sun Mar 01 21:43:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pglist.c,v 1.80 2020/02/20 04:54:47 rin Exp $      */
+/*     $NetBSD: uvm_pglist.c,v 1.81 2020/03/01 21:43:56 ad Exp $       */
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,10 +35,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.80 2020/02/20 04:54:47 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.81 2020/03/01 21:43:56 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/cpu.h>
 
 #include <uvm/uvm.h>
 #include <uvm/uvm_pdpolicy.h>
@@ -514,6 +515,8 @@
 {
        int num, res;
 
+       KASSERT(!cpu_intr_p());
+       KASSERT(!cpu_softintr_p());
        KASSERT((alignment & (alignment - 1)) == 0);
        KASSERT((boundary & (boundary - 1)) == 0);
 
@@ -562,6 +565,9 @@
        struct vm_page *pg;
        int c, b;
 
+       KASSERT(!cpu_intr_p());
+       KASSERT(!cpu_softintr_p());
+
        /*
         * Lock the free list and free each page.
         */



Home | Main Index | Thread Index | Old Index