NetBSD Problem Report #56764
From www@netbsd.org Mon Mar 21 09:34:45 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 88FE61A921F
for <gnats-bugs@gnats.NetBSD.org>; Mon, 21 Mar 2022 09:34:45 +0000 (UTC)
Message-Id: <20220321093444.096081A9239@mollari.NetBSD.org>
Date: Mon, 21 Mar 2022 09:34:43 +0000 (UTC)
From: prlw1@cam.ac.uk
Reply-To: prlw1@cam.ac.uk
To: gnats-bugs@NetBSD.org
Subject: panic assertion "uvmexp.swpgonly > 0"
X-Send-Pr-Version: www-1.0
>Number: 56764
>Category: kern
>Synopsis: panic assertion "uvmexp.swpgonly > 0"
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Mar 21 09:35:00 +0000 2022
>Last-Modified: Mon Aug 25 12:00:01 +0000 2025
>Originator: Patrick Welche
>Release: NetBSD-9.99.95/amd64 20 Mar 2022
>Organization:
>Environment:
>Description:
During "shutdown -p now" of a pbulk run that was swapping heavily (has
something changed with libreoffice?), the following panic happened
(leaving disks needing fsck -y)
(gdb) print panicstr
$1 = 0xffffffff8151cc80 <scratchstr> "kernel diagnostic assertion \"uvmexp.swpgonly > 0\" failed: file \"../../../../uvm/uvm_swap.c\", line 1830 "
(gdb) bt
#0 0xffffffff802229c5 in cpu_reboot (howto=howto@entry=260,
bootstr=bootstr@entry=0x0) at ../../../../arch/amd64/amd64/machdep.c:720
#1 0xffffffff80aca704 in kern_reboot (howto=howto@entry=260,
bootstr=bootstr@entry=0x0) at ../../../../kern/kern_reboot.c:73
#2 0xffffffff80b0db72 in vpanic (
fmt=0xffffffff80fce6f0 "kernel %sassertion \"%s\" failed: file \"%s\", line %d ", ap=ap@entry=0xffffab04b0be4ad8) at ../../../../kern/subr_prf.c:290
#3 0xffffffff80c81c8f in kern_assert (
fmt=fmt@entry=0xffffffff80fce6f0 "kernel %sassertion \"%s\" failed: file \"%s\", line %d ") at ../../../../../../lib/libkern/kern_assert.c:51
#4 0xffffffff80a8793d in uvm_swap_get (page=<optimized out>,
page@entry=0xffffab0020000d00, swslot=<optimized out>, flags=flags@entry=2)
at ../../../../uvm/uvm_swap.c:1830
#5 0xffffffff80a6798e in uvmfault_anonget (ufi=ufi@entry=0x0,
amap=amap@entry=0xffff9665d0e40198, anon=anon@entry=0xffff9665db0cdad8)
at ../../../../uvm/uvm_fault.c:392
#6 0xffffffff80a61bb8 in uvm_anon_pagein (amap=amap@entry=0xffff9665d0e40198,
anon=0xffff9665db0cdad8) at ../../../../uvm/uvm_anon.c:287
#7 0xffffffff80a60ad2 in amap_swap_off (startslot=1, endslot=122095319)
at ../../../../uvm/uvm_amap.c:1402
#8 0xffffffff80a8513b in swap_off (l=l@entry=0xffff9665e3dde480,
sdp=0xffff9665d12ed100) at ../../../../uvm/uvm_swap.c:1082
#9 0xffffffff80a86af7 in sys_swapctl (l=0xffff9665e3dde480,
uap=0xffffab04b0be4f00, retval=<optimized out>)
at ../../../../uvm/uvm_swap.c:748
#10 0xffffffff803fd09e in sy_call (rval=0xffffab04b0be4eb0,
uap=0xffffab04b0be4f00, l=0xffff9665e3dde480,
sy=0xffffffff814639e8 <sysent+6504>) at ../../../../sys/syscallvar.h:65
#11 sy_invoke (code=271, rval=0xffffab04b0be4eb0, uap=0xffffab04b0be4f00,
l=0xffff9665e3dde480, sy=0xffffffff814639e8 <sysent+6504>)
at ../../../../sys/syscallvar.h:94
#12 syscall (frame=0xffffab04b0be4f00)
at ../../../../arch/x86/x86/syscall.c:138
#13 0xffffffff8020867d in handle_syscall ()
#14 0x0000000000000002 in ?? ()
#15 0x00007f7fffffd7f0 in ?? ()
#16 0x0000000000000000 in ?? ()
(gdb) print uvmexp
$5 = {pagesize = 4096, pagemask = 4095, pageshift = 12, npages = 16245534,
free = 5948528, paging = 0, wired = 4978, ncolors = 16, colormask = 15,
zeropages = 0, reserve_pagedaemon = 1, reserve_kernel = 80,
anonpages = 12304, filepages = 6062858, execpages = 16584, freemin = 4096,
freetarg = 5461, wiredmax = 5415178, nswapdev = 1, swpages = 122095317,
swpgavail = 0, swpginuse = 2, swpgonly = 0, nswget = 1903783,
faults = 1647202138, traps = 1648322817, intrs = 4570866, swtch = 73563035,
softs = 8174162, syscalls = -1962293868, pageins = 68644, _unused1 = 0,
_unused2 = 0, pgswapin = 0, pgswapout = 5382281, forks = 2573596,
forks_ppwait = 1630951, forks_sharevm = 1630951, pga_zerohit = 0,
pga_zeromiss = 0, zeroaborts = 0, colorhit = 1333019305,
colormiss = 139555180, cpuhit = 1156296487, cpumiss = 316277998,
fltnoram = 11842172, fltnoanon = 0, fltpgwait = 53, fltpgrele = 0,
fltrelck = 452245, fltrelckok = 452073, fltanget = 59468194,
fltanretry = 68735, fltamcopy = 157083835, fltnamap = 55460761,
fltnomap = 1168414334, fltlget = 326455861, fltget = 415713,
flt_anon = 35398387, flt_acow = 24037224, flt_obj = 245215384,
flt_prcopy = 81224287, flt_przero = 1245736078, pdwoke = 3499331,
pdrevs = 1612, _unused3 = 0, pdfreed = 31670364, pdscans = 62863648,
pdanscan = 229129, pdobscan = 31441586, pdreact = 35679, pdbusy = 0,
pdpageouts = 337035, pdpending = 5045166, pddeact = 66951433, pdreanon = 0,
pdrefile = 0, pdreexec = 0, bootpages = 507705}
>How-To-Repeat:
>Fix:
>Audit-Trail:
From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: Chuck Silvers <chuq@chuq.com>
Subject: Re: kern/56764: panic assertion "uvmexp.swpgonly > 0"
Date: Mon, 25 Aug 2025 13:55:38 +0200
I haven't seen this particular panic yet, but I have problems with
this counter since at least 2017.
My latest one was
panic: kernel diagnostic assertion "uvmexp.swpgonly < uvmexp.swpginuse" failed: file "/usr/src/sys/uvm/uvm_pdaemon.c", line 795
The backtrace is
(gdb) bt
#0 0xffffffff80239b85 in cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at /usr/src/sys/arch/amd64/amd64/machdep.c:709
#1 0xffffffff80de5a95 in kern_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at /usr/src/sys/kern/kern_reboot.c:91
#2 0xffffffff80e2ba63 in vpanic (fmt=0xffffffff81427c00 "kernel %sassertion \"%s\" failed: file \"%s\", line %d ", ap=ap@entry=0xffffc1a47baa2e98) at /usr/src/sys/kern/subr_prf.c:288
#3 0xffffffff80ffb6fe in kern_assert (fmt=fmt@entry=0xffffffff81427c00 "kernel %sassertion \"%s\" failed: file \"%s\", line %d ") at /usr/src/sys/lib/libkern/kern_assert.c:51
#4 0xffffffff80d9532c in uvmpd_scan_queue () at /usr/src/sys/uvm/uvm_pdaemon.c:795
#5 uvmpd_scan () at /usr/src/sys/uvm/uvm_pdaemon.c:917
#6 uvm_pageout (arg=<optimized out>) at /usr/src/sys/uvm/uvm_pdaemon.c:318
#7 0xffffffff80210327 in lwp_trampoline ()
#8 0x0000000000000000 in ?? ()
Chuck Silvers took a number of looks at this over the years, and his
best guess is that the counters are not maintained correctly, but we
haven't found the root cause of this.
Thomas
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.