From 63f8896919fdfd2d0686bc7d7ffb74620f295415 Mon Sep 17 00:00:00 2001 From: mpi Date: Thu, 30 May 2024 10:56:24 +0000 Subject: [PATCH] Ensure pmap_create() waits in case kernel virtual space shortage. Prevents a panic in pmap_pinit_pd_pae() when applying a lot of memory pressure and the kernel needs time to recover while swapping. Reported and fix tested by mvs@, also tested by sthen@ ok mlarkin@, mvs@, kettenis@ --- sys/arch/i386/i386/pmapae.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/i386/i386/pmapae.c b/sys/arch/i386/i386/pmapae.c index 37e77ecbc3b..c88ec8ffebb 100644 --- a/sys/arch/i386/i386/pmapae.c +++ b/sys/arch/i386/i386/pmapae.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmapae.c,v 1.71 2023/05/30 08:30:01 jsg Exp $ */ +/* $OpenBSD: pmapae.c,v 1.72 2024/05/30 10:56:24 mpi Exp $ */ /* * Copyright (c) 2006-2008 Michael Shalayeff @@ -990,7 +990,7 @@ pmap_pinit_pd_pae(struct pmap *pmap) if (cpu_meltdown) { int i; - va = (vaddr_t)km_alloc(4 * NBPG, &kv_any, &kp_zero, &kd_nowait); + va = (vaddr_t)km_alloc(4 * NBPG, &kv_any, &kp_zero, &kd_waitok); if (va == 0) panic("%s: kernel_map out of virtual space!", __func__); if (!pmap_extract(pmap_kernel(), -- 2.20.1