Module Name:    src
Committed By:   mrg
Date:           Tue Nov 13 10:31:01 UTC 2018

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/uvm/uvm_pglist.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_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.71 src/sys/uvm/uvm_pglist.c:1.72
--- src/sys/uvm/uvm_pglist.c:1.71	Mon Sep  3 16:29:37 2018
+++ src/sys/uvm/uvm_pglist.c	Tue Nov 13 10:31:01 2018
@@ -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 @@ uvm_pglistalloc_simple(int num, paddr_t 
 {
 	int fl, error;
 	uvm_physseg_t psi;
+	int count = 0;
 
 	/* Default to "lose". */
 	error = ENOMEM;
@@ -462,6 +463,7 @@ again:
 	 * 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 @@ out:
 		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;

Reply via email to