Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm Add uvm_free(): returns number of free pages in system.



details:   https://anonhg.NetBSD.org/src/rev/db8d648518c0
branches:  trunk
changeset: 967763:db8d648518c0
user:      ad <ad%NetBSD.org@localhost>
date:      Sat Dec 21 12:58:26 2019 +0000

description:
Add uvm_free(): returns number of free pages in system.

diffstat:

 sys/rump/librump/rumpkern/vm.c |  11 +++++++++--
 sys/uvm/uvm_extern.h           |   3 ++-
 sys/uvm/uvm_page.c             |  15 +++++++++++++--
 3 files changed, 24 insertions(+), 5 deletions(-)

diffs (85 lines):

diff -r 4a00523e3f8b -r db8d648518c0 sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c    Sat Dec 21 12:53:53 2019 +0000
+++ b/sys/rump/librump/rumpkern/vm.c    Sat Dec 21 12:58:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm.c,v 1.176 2019/12/15 21:11:35 ad Exp $      */
+/*     $NetBSD: vm.c,v 1.177 2019/12/21 12:59:12 ad Exp $      */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.176 2019/12/15 21:11:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.177 2019/12/21 12:59:12 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -409,6 +409,13 @@
        /* nada */
 }
 
+int
+uvm_free(void)
+{
+
+       return uvmexp.free;
+}
+
 /* where's your schmonz now? */
 #define PUNLIMIT(a)    \
 p->p_rlimit[a].rlim_cur = p->p_rlimit[a].rlim_max = RLIM_INFINITY;
diff -r 4a00523e3f8b -r db8d648518c0 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Sat Dec 21 12:53:53 2019 +0000
+++ b/sys/uvm/uvm_extern.h      Sat Dec 21 12:58:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_extern.h,v 1.214 2019/12/16 22:47:55 ad Exp $      */
+/*     $NetBSD: uvm_extern.h,v 1.215 2019/12/21 12:58:26 ad Exp $      */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -735,6 +735,7 @@
 void                   uvm_obj_unwirepages(struct uvm_object *, off_t, off_t);
 
 /* uvm_page.c */
+int                    uvm_free(void);
 struct vm_page         *uvm_pagealloc_strat(struct uvm_object *,
                            voff_t, struct vm_anon *, int, int, int);
 #define        uvm_pagealloc(obj, off, anon, flags) \
diff -r 4a00523e3f8b -r db8d648518c0 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Sat Dec 21 12:53:53 2019 +0000
+++ b/sys/uvm/uvm_page.c        Sat Dec 21 12:58:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.206 2019/12/18 20:38:14 ad Exp $        */
+/*     $NetBSD: uvm_page.c,v 1.207 2019/12/21 12:58:26 ad Exp $        */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.206 2019/12/18 20:38:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.207 2019/12/21 12:58:26 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -746,6 +746,17 @@
 }
 
 /*
+ * uvm_free: return total number of free pages in system.
+ */
+
+int
+uvm_free(void)
+{
+
+       return uvmexp.free;
+}
+
+/*
  * uvm_pagealloc_pgfl: helper routine for uvm_pagealloc_strat
  */
 



Home | Main Index | Thread Index | Old Index