NetBSD Problem Report #58458

From www@netbsd.org  Tue Jul 23 11:03:31 2024
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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EDB501A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 23 Jul 2024 11:03:30 +0000 (UTC)
Message-Id: <20240723110329.8BED41A923B@mollari.NetBSD.org>
Date: Tue, 23 Jul 2024 11:03:29 +0000 (UTC)
From: tnn@nygren.pp.se
Reply-To: tnn@nygren.pp.se
To: gnats-bugs@NetBSD.org
Subject: sys/uvm/uvm_pdpolicy_clock.c:450: diagassert failed "(pg->pqflags & (PQ_INTENT_MASK | PQ_INTENT_S ET)) != (PQ_INTENT_D | PQ_INTENT_SET)"
X-Send-Pr-Version: www-1.0

>Number:         58458
>Category:       kern
>Synopsis:       sys/uvm/uvm_pdpolicy_clock.c:450: diagassert failed "(pg->pqflags & (PQ_INTENT_MASK | PQ_INTENT_S ET)) != (PQ_INTENT_D | PQ_INTENT_SET)"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 23 11:05:00 +0000 2024
>Last-Modified:  Sat Sep 05 18:25:01 +0000 2026
>Originator:     Tobias Nygren
>Release:        10.99.11
>Organization:
>Environment:
Adlink AADK 64-core
>Description:
This panic happens about once every ten reboots and it is always just
after ntpd has forked to the background.

Starting ntpd.
panic: kernel diagnostic assertion "(pg->pqflags & (PQ_INTENT_MASK | PQ_INTENT_S
ET)) != (PQ_INTENT_D | PQ_INTENT_SET)" failed: file "/work/src/sys/uvm/uvm_pdpol
icy_clock.c", line 450
cpu60: Begin traceback...
trace fp ffffc03060ccfae0
fp ffffc03060ccfb10 vpanic() at ffffc000005b8520 netbsd:vpanic+0x1a0
fp ffffc03060ccfb80 kern_assert() at ffffc000009b4c78 netbsd:kern_assert+0x58
fp ffffc03060ccfc10 uvmpdpol_pagedeactivate_locked() at ffffc00000524e3c netbsd:
uvmpdpol_pagedeactivate_locked+0x13c
fp ffffc03060ccfc30 uvmpdpol_balancequeue() at ffffc00000525ea8 netbsd:uvmpdpol_
balancequeue+0x188
fp ffffc03060ccfd30 uvm_pageout() at ffffc000005249e8 netbsd:uvm_pageout+0x51c
tf ffffc03060ccfed0 el0_trap() at ffffc000000b6ff0 netbsd:el1_trap_exit+0x68
cpu60: End traceback...
rebooting...
>How-To-Repeat:
Probably run ntpd on a fast system with many cores and some other unknown circumstance.
>Fix:

>Audit-Trail:
From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/58458: sys/uvm/uvm_pdpolicy_clock.c:450: diagassert failed
 "(pg->pqflags & (PQ_INTENT_MASK | PQ_INTENT_S ET)) != (PQ_INTENT_D | PQ_INTENT_SET)"
Date: Sat, 5 Sep 2026 20:24:05 +0200

 Begin forwarded message:

 Date: Sat, 5 Sep 2026 16:53:05 +0000
 From: "Thor Lancelot Simon" <tls@netbsd.org>
 To: source-changes@NetBSD.org
 Subject: CVS commit: src/sys/uvm


 Module Name:	src
 Committed By:	tls
 Date:		Sat Sep  5 16:53:05 UTC 2026

 Modified Files:
 	src/sys/uvm: uvm_pdpolicy_clock.c uvm_pdpolicy_clockpro.c

 Log Message:
 Fix a very brief race which could cause page states to be corrupted.

 Observed under heavy physio load from an 8-way parallel dump|restore
 workload used in filesystem testing - manifested as intents being
 scribbled over while the interlock was momentarily not held
 in uvmpdpol_selectvictim.  I've attempted to apply the same fix to
 clockpro, which looks like it needs it too, but clockpro was on fire
 when I got there and I didn't put it out (still does not compile).


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/sys/uvm/uvm_pdpolicy_clock.c
 cvs rdiff -u -r1.27 -r1.28 src/sys/uvm/uvm_pdpolicy_clockpro.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.