Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm only warn once per call to uvm_pglistalloc_simple() ...



details:   https://anonhg.NetBSD.org/src/rev/3af603fc54e7
branches:  trunk
changeset: 994554:3af603fc54e7
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Nov 13 10:31:01 2018 +0000

description:
only warn once per call to uvm_pglistalloc_simple() if waiting.

diffstat:

 sys/uvm/uvm_pglist.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 4dcea5c7927b -r 3af603fc54e7 sys/uvm/uvm_pglist.c
--- a/sys/uvm/uvm_pglist.c      Tue Nov 13 10:30:57 2018 +0000
+++ b/sys/uvm/uvm_pglist.c      Tue Nov 13 10:31:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pglist.c,v 1.71 2018/09/03 16:29:37 riastradh Exp $        */
+/*     $NetBSD: uvm_pglist.c,v 1.72 2018/11/13 10:31:01 mrg Exp $      */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.71 2018/09/03 16:29:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.72 2018/11/13 10:31:01 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -453,6 +453,7 @@
 {
        int fl, error;
        uvm_physseg_t psi;
+       int count = 0;
 
        /* Default to "lose". */
        error = ENOMEM;
@@ -462,6 +463,7 @@
         * Block all memory allocation and lock the free list.
         */
        mutex_spin_enter(&uvm_fpageqlock);
+       count++;
 
        /* Are there even any free pages? */
        if (uvmexp.free <= (uvmexp.reserve_pagedaemon + uvmexp.reserve_kernel))
@@ -499,7 +501,8 @@
                if (waitok) {
                        /* XXX perhaps some time limitation? */
 #ifdef DEBUG
-                       printf("pglistalloc waiting\n");
+                       if (count == 1)
+                               printf("pglistalloc waiting\n");
 #endif
                        uvm_wait("pglalloc");
                        goto again;



Home | Main Index | Thread Index | Old Index