NetBSD Problem Report #56309

From kardel@kardel.name  Wed Jul 14 08:13:14 2021
Return-Path: <kardel@kardel.name>
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 802431A921F
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 14 Jul 2021 08:13:14 +0000 (UTC)
Message-Id: <20210714081200.56A15AAAC818@pip.kardel.name>
Date: Wed, 14 Jul 2021 10:12:00 +0200 (CEST)
From: kardel@netbsd.org
Reply-To: kardel@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: swapctl -U is very inefficient (takes ages to eternities)
X-Send-Pr-Version: 3.95

>Number:         56309
>Category:       kern
>Synopsis:       swapctl -U is very inefficient (takes ages to eternities)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 14 08:15:00 +0000 2021
>Last-Modified:  Wed Jul 14 08:28:49 +0000 2021
>Originator:     Frank Kardel
>Release:        NetBSD 9.99.80 (also - .85 and likely beyond)
>Organization:

>Environment:


System: NetBSD pip 9.99.80 NetBSD 9.99.80 (PIPGEN) #0: Thu Feb 11 20:11:26 CET 2021 kardel@pip:/src/NetBSD/cur/src/obj.amd64/sys/arch/amd64/compile/PIPGEN amd64
Architecture: x86_64
Machine: amd64
>Description:
	On a system with swap configured and swap having been used shutdown can
	take a very long time when shutting down in the "Removing block-type swap devices"
	phase. The read rate from the swap devices is very low for rust media and slow
	for SSD media. swapctl -U picks up significant CPU time. The whole process takes
	eternities for rust media and ages for SSDs.

Example (about 7 minutes into the shutdown):
   0 12876 23709 25309 117 -20    19376     1656 -       O<   ?       6:18.30 swapctl -U -t blk
   0   188 22490    84 117   0    17820     1400 tstile  D+   pts/2   0:00.00 swapctl -l

	On rust media the shutdown can take several hours. Even SSDs(NVME) can take several
	tens of minutes. 

>How-To-Repeat:
	Use a system with swap enabled. Force the system to use swap space. Watch
	a very long shutdown.
>Fix:
	Workaround: set swapoff=NO in /etc/rc.conf.

>Release-Note:

>Audit-Trail:

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.