Index | Thread | Search

From:
Martin Pieuchot <mpi@openbsd.org>
Subject:
Piglet allocation comment
To:
tech@openbsd.org
Date:
Sat, 17 Aug 2024 11:25:53 +0200

Download raw body.

Thread
Remove a lie about the piglet allocation.  km_alloc(9) is called with
`kd_nowait' as argument so uvm_pglistalloc(9) won't wait.

There is no guarantee that the page daemon will ever be able to free
enough memory with a given range constraint.  That's why allocating
such memory early, as discussed recently, is the way to go.

ok?

Index: kern/subr_hibernate.c
===================================================================
RCS file: /cvs/src/sys/kern/subr_hibernate.c,v
diff -u -p -r1.141 subr_hibernate.c
--- kern/subr_hibernate.c	5 Jun 2024 11:04:17 -0000	1.141
+++ kern/subr_hibernate.c	17 Aug 2024 09:19:21 -0000
@@ -470,10 +470,6 @@ uvm_pmr_alloc_pig(paddr_t *pa, psize_t s
  * Piglets are aligned.
  *
  * sz and align in bytes.
- *
- * The call will sleep for the pagedaemon to attempt to free memory.
- * The pagedaemon may decide its not possible to free enough memory, causing
- * the allocation to fail.
  */
 int
 uvm_pmr_alloc_piglet(vaddr_t *va, paddr_t *pa, vsize_t sz, paddr_t align)