-/* $OpenBSD: pmap.h,v 1.40 2016/04/20 05:24:18 landry Exp $ */
+/* $OpenBSD: pmap.h,v 1.41 2022/09/10 20:35:28 miod Exp $ */
/* $NetBSD: pmap.h,v 1.37 2000/11/19 03:16:35 thorpej Exp $ */
/*-
paddr_t vtophys(vaddr_t);
+#define __HAVE_PMAP_COLLECT
+
/* Machine-specific functions. */
void pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids);
int pmap_emulate_reference(struct proc *p, vaddr_t v, int user, int type);
-/* $OpenBSD: pmap.c,v 1.153 2022/06/30 13:51:24 mlarkin Exp $ */
+/* $OpenBSD: pmap.c,v 1.154 2022/09/10 20:35:28 miod Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
#endif
}
+#if 0
/*
* pmap_collect: free resources held by a pmap
*
* for its entire address space.
*/
-/* pmap_do_remove(pmap, VM_MIN_ADDRESS, VM_MAX_ADDRESS,
+ pmap_do_remove(pmap, VM_MIN_ADDRESS, VM_MAX_ADDRESS,
PMAP_REMOVE_SKIPWIRED);
-*/
}
+#endif
/*
* pmap_copy: copy mappings from one pmap to another
-/* $OpenBSD: pmap7.c,v 1.63 2022/02/21 19:15:58 kettenis Exp $ */
+/* $OpenBSD: pmap7.c,v 1.64 2022/09/10 20:35:28 miod Exp $ */
/* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */
/*
return 0;
}
-/*
- * pmap_collect: free resources held by a pmap
- *
- * => optional function.
- * => called when a process is swapped out to free memory.
- */
-void
-pmap_collect(pmap_t pm)
-{
- /*
- * Nothing to do.
- * We don't even need to free-up the process' L1.
- */
-}
-
/*
* Routine: pmap_proc_iflush
*
-/* $OpenBSD: pmap.c,v 1.84 2022/01/10 09:20:27 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.85 2022/09/10 20:35:28 miod Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
*
pted->pted_pte |= flags & (PROT_READ|PROT_WRITE|PROT_EXEC);
}
-/*
- * Garbage collects the physical map system for pages which are
- * no longer used. Success need not be guaranteed -- that is, there
- * may well be pages which are not referenced, but others may be collected
- * Called by the pageout daemon when pages are scarce.
- */
-void
-pmap_collect(pmap_t pm)
-{
- /* This could return unused v->p table layers which
- * are empty.
- * could malicious programs allocate memory and eat
- * these wired pages? These are allocated via pool.
- * Are there pool functions which could be called
- * to lower the pool usage here?
- */
-}
-
/*
* Fill the given physical page with zeros.
*/
-/* $OpenBSD: pmap.c,v 1.177 2021/09/14 16:16:51 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.178 2022/09/10 20:35:28 miod Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
atomic_inc_int(&pmap->pm_obj.uo_refs);
}
-void
-pmap_collect(struct pmap *pmap)
-{
- DPRINTF(PDB_FOLLOW|PDB_PMAP, ("pmap_collect(%p)\n", pmap));
- /* nothing yet */
-}
-
int
pmap_enter(struct pmap *pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, int flags)
{
-/* $OpenBSD: param.h,v 1.47 2018/09/14 13:58:20 claudio Exp $ */
+/* $OpenBSD: param.h,v 1.48 2022/09/10 20:35:28 miod Exp $ */
/*
* Copyright (c) 1988-1994, The University of Utah and
#endif /* _KERNEL */
#define MACHINE_STACK_GROWS_UP 1 /* stack grows to higher addresses */
-#define __SWAP_BROKEN
#endif /* _MACHINE_PARAM_H_ */
-/* $OpenBSD: pmap.h,v 1.26 2015/07/25 20:45:05 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.27 2022/09/10 20:35:28 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
#define pmap_unmap_direct(va) PHYS_TO_VM_PAGE((paddr_t)va)
#define __HAVE_PMAP_DIRECT
#define PMAP_STEAL_MEMORY
+#define __HAVE_PMAP_COLLECT
#endif /* _KERNEL */
-/* $OpenBSD: pmap.h,v 1.49 2021/05/01 16:11:11 visa Exp $ */
+/* $OpenBSD: pmap.h,v 1.50 2022/09/10 20:35:28 miod Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
vaddr_t pmap_map_direct(vm_page_t);
vm_page_t pmap_unmap_direct(vaddr_t);
+#define __HAVE_PMAP_COLLECT
+
/*
* MD flags to pmap_enter:
*/
-/* $OpenBSD: pmap.c,v 1.176 2022/02/07 23:20:09 gkoehler Exp $ */
+/* $OpenBSD: pmap.c,v 1.177 2022/09/10 20:35:28 miod Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
return bits;
}
-/*
- * Garbage collects the physical map system for pages which are
- * no longer used. Success need not be guaranteed -- that is, there
- * may well be pages which are not referenced, but others may be collected
- * Called by the pageout daemon when pages are scarce.
- */
-void
-pmap_collect(pmap_t pm)
-{
- /* This could return unused v->p table layers which
- * are empty.
- * could malicious programs allocate memory and eat
- * these wired pages? These are allocated via pool.
- * Are there pool functions which could be called
- * to lower the pool usage here?
- */
-}
-
/*
* Fill the given physical page with zeros.
*/
-/* $OpenBSD: pmap.c,v 1.57 2021/10/12 18:06:15 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.58 2022/09/10 20:35:28 miod Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
PMAP_VP_UNLOCK(pm);
}
-void
-pmap_collect(pmap_t pm)
-{
-}
-
void
pmap_zero_page(struct vm_page *pg)
{
-/* $OpenBSD: pmap.c,v 1.22 2022/08/29 02:01:18 jsg Exp $ */
+/* $OpenBSD: pmap.c,v 1.23 2022/09/10 20:35:29 miod Exp $ */
/*
* Copyright (c) 2019-2020 Brian Bamsch <bbamsch@google.com>
pted->pted_pte |= flags & (PROT_READ|PROT_WRITE|PROT_EXEC);
}
-/*
- * Garbage collects the physical map system for pages which are
- * no longer used. Success need not be guaranteed -- that is, there
- * may well be pages which are not referenced, but others may be collected
- * Called by the pageout daemon when pages are scarce.
- */
-void
-pmap_collect(pmap_t pm)
-{
- /* This could return unused v->p table layers which
- * are empty.
- * could malicious programs allocate memory and eat
- * these wired pages? These are allocated via pool.
- * Are there pool functions which could be called
- * to lower the pool usage here?
- */
-}
-
/*
* Fill the given physical page with zeros.
*/
-/* $OpenBSD: pmap.h,v 1.14 2015/02/15 21:34:33 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.15 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: pmap.h,v 1.28 2006/04/10 23:12:11 uwe Exp $ */
/*-
#define pmap_deactivate(pmap) do { /* nothing */ } while (0)
#define pmap_update(pmap) do { /* nothing */ } while (0)
#define pmap_copy(dp,sp,d,l,s) do { /* nothing */ } while (0)
-#define pmap_collect(pmap) do { /* nothing */ } while (0)
#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
#define PMAP_GROWKERNEL /* turn on pmap_growkernel interface */
+#define __HAVE_PMAP_COLLECT
+
/* SPARC specific? */
void pmap_redzone(void);
int pmap_dumpsize(void);
-/* $OpenBSD: pmap.c,v 1.105 2022/09/08 17:44:48 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.106 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */
/*
*
void
pmap_collect(struct pmap *pm)
{
-#if 1
int i, j, k, n, m, s;
paddr_t *pdir, *ptbl;
/* This is a good place to scan the pmaps for page tables with
}
}
splx(s);
-#endif
}
void
-/* $OpenBSD: uvm_glue.c,v 1.83 2022/03/12 08:11:07 mpi Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.84 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: uvm_glue.c,v 1.44 2001/02/06 19:54:44 eeh Exp $ */
/*
limit0->pl_rlimit[RLIMIT_RSS].rlim_cur = ptoa(uvmexp.free);
}
+#ifdef __HAVE_PMAP_COLLECT
+
#ifdef DEBUG
int enableswap = 1;
int swapdebug = 0;
}
}
+#endif /* __HAVE_PMAP_COLLECT */
+
/*
* uvm_atopg: convert KVAs back to their page structures.
*/
-/* $OpenBSD: uvm_pdaemon.c,v 1.104 2022/08/31 09:26:04 mpi Exp $ */
+/* $OpenBSD: uvm_pdaemon.c,v 1.105 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */
/*
*/
free = uvmexp.free - BUFPAGES_DEFICIT;
-#ifndef __SWAP_BROKEN
+#ifdef __HAVE_PMAP_COLLECT
/*
* swap out some processes if we are below our free target.
* we need to unlock the page queues for this.
-/* $OpenBSD: uvm_pmap.h,v 1.30 2022/08/07 19:39:25 miod Exp $ */
+/* $OpenBSD: uvm_pmap.h,v 1.31 2022/09/10 20:35:29 miod Exp $ */
/* $NetBSD: uvm_pmap.h,v 1.1 2000/06/27 09:00:14 mrg Exp $ */
/*
boolean_t pmap_clear_reference(struct vm_page *);
#endif
-#if !defined(pmap_collect)
+#if !defined(pmap_collect) && defined(__HAVE_PMAP_COLLECT)
void pmap_collect(pmap_t);
#endif
#if !defined(pmap_copy)