Index | Thread | Search

From:
Martin Pieuchot <mpi@grenadille.net>
Subject:
uvm_anfree()
To:
tech@openbsd.org
Date:
Thu, 11 Dec 2025 14:39:19 +0100

Download raw body.

Thread
  • Martin Pieuchot:

    uvm_anfree()

Kill unused `pgl' argument.  ok?

Index: uvm/uvm_anon.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_anon.c,v
diff -u -p -r1.65 uvm_anon.c
--- uvm/uvm_anon.c	10 Dec 2025 08:38:18 -0000	1.65
+++ uvm/uvm_anon.c	11 Dec 2025 11:39:06 -0000
@@ -79,14 +79,13 @@ uvm_analloc(void)
 }
 
 /*
- * uvm_anfree_list: free a single anon structure
+ * uvm_anfree: free a single anon structure
  *
  * => anon must be removed from the amap (if anon was in an amap).
  * => amap must be locked, if anon was owned by amap.
- * => we may lock the pageq's.
  */
 void
-uvm_anfree_list(struct vm_anon *anon, struct pglist *pgl)
+uvm_anfree(struct vm_anon *anon)
 {
 	struct vm_page *pg = anon->an_page;
 
@@ -109,16 +108,7 @@ uvm_anfree_list(struct vm_anon *anon, st
 			return;
 		}
 		pmap_page_protect(pg, PROT_NONE);
-		if (pgl != NULL) {
-			/*
-			 * clean page, and put it on pglist
-			 * for later freeing.
-			 */
-			uvm_pageclean(pg);
-			TAILQ_INSERT_HEAD(pgl, pg, pageq);
-		} else {
-			uvm_pagefree(pg);	/* bye bye */
-		}
+		uvm_pagefree(pg);
 	} else {
 		if (anon->an_swslot != 0 && anon->an_swslot != SWSLOT_BAD) {
 			/* This page is no longer only in swap. */
Index: uvm/uvm_anon.h
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_anon.h,v
diff -u -p -r1.23 uvm_anon.h
--- uvm/uvm_anon.h	16 Apr 2025 09:16:48 -0000	1.23
+++ uvm/uvm_anon.h	11 Dec 2025 11:31:25 -0000
@@ -88,7 +88,7 @@ struct vm_aref {
 
 #ifdef _KERNEL
 struct vm_anon	*uvm_analloc(void);
-void		 uvm_anfree_list(struct vm_anon *, struct pglist *);
+void		 uvm_anfree(struct vm_anon *);
 void		 uvm_anon_release(struct vm_anon *);
 void		 uvm_anwait(void);
 void		 uvm_anon_init(void);
@@ -96,7 +96,6 @@ void		 uvm_anon_init_percpu(void);
 void		 uvm_anon_dropswap(struct vm_anon *);
 boolean_t	 uvm_anon_pagein(struct vm_amap *, struct vm_anon *);
 
-#define		uvm_anfree(an)	uvm_anfree_list((an), NULL)
 
 #endif /* _KERNEL */