From nobody Thu Apr 17 10:13:59 2025 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZdYdh5FtQz5swSF for ; Thu, 17 Apr 2025 10:14:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZdYdh1tBfz4CT6 for ; Thu, 17 Apr 2025 10:14:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744884840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ctTfWKgyiXphh2Jqqe5/QVtAW2tD5DEGUyUTmakcOO0=; b=clSOOqJHQmZ7e1b8Ce9voAyOBJi6JxU1zav782AJHRt+q9DDhYWSBevChKWRuicC04jBBr ZjXArNls2uCjpNTJwaYVw6aO+1CseGv6h/N1ZomGMyxM+y2UC3DYi8fhOZtvIBuuKYdiGG k3Q3eN0zGKesmpZcp3KqLCr9lPXP9viSRoalhB4KgJU3UT52ZORS7rcbqQEWIK3Hvr42/2 shxFgeHanHnl7CFs4vYym4Wsk3smG0EdxIfFAQ0APLR+AJjE1VcMDCW6q6XUJnrGCVxd/E TaqRmIPRlGUw6udZ6xubjldSIL07qb44wmCwP+cz/qMPzlcRm569ccmq1FqLzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744884840; a=rsa-sha256; cv=none; b=NQ4AuHLFlUJ+hqpS1KozFzUwRUJmTZauC11yRY+Hm7W1KEU6fO8cT4JzltuGeqGGXTHfuZ gnjggAh4RcoKnswyjaiTAHNmwWi7vNOYzOmmLXeAhDQkUUONSWTPZLiKO99ACGceWbd7Mr HfmD8ZuIDLDJU6meppe0zO5/HhatX7GxrR3RtxJ+uaj/isQ/UMjfWlRAHHwRlsufrl0SRq XyvJPb+O5FcBomzo+ZNA1QSFosM/+xdjnD4QOMaebpeRdyPydCGuJVVa/hodePy8dKSzCL 85hf4tzAessDL16lF4FXPyiS6fTGpdjsh2I+JSId0N/6/OVXla287giP1elZBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744884840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ctTfWKgyiXphh2Jqqe5/QVtAW2tD5DEGUyUTmakcOO0=; b=a/LhY3/d7/1u74CY3xsroN5jvJaGIhYJD6A5X6JGMzclZ6448btzfDY4xTxOVqQ9VTFi05 2Jtfq5HA30PHlzQbU3gXxE4ANGSfkazQrTYxODM1Oscp3eKxb9/f9ZOPZe47SSbu/JMVkS f32Qpr7ARF+++GQQDHDYm5Px3eQtE9baH8iGKIf7Y9sDS/R3tjUwO5UezYZXjrSJvw+ae2 9NSWQogu4DkIp0xf3VFOi+A0xpPnmoXyXTOazuMilXQQbxtORw2fEZGI+67+E8LO+nsktq f2fZx2lwFK05Wgunkt5m15Zk3hHutwZs7kmDnKftqz8PSOXk4E5gG/tnRI9Abg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZdYdh1JMMzl8n for ; Thu, 17 Apr 2025 10:14:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 53HAE0gY057759 for ; Thu, 17 Apr 2025 10:14:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 53HAE0QL057753 for bugs@FreeBSD.org; Thu, 17 Apr 2025 10:14:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 286152] do not swap in while shutting down Date: Thu, 17 Apr 2025 10:13:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: avg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D286152 Bug ID: 286152 Summary: do not swap in while shutting down Product: Base System Version: 15.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: avg@FreeBSD.org The code to turn off swap during shutdown is the same code that is used to = turn swap during normal system operation, e.g., with swapoff command. It makes total sense that during normal operation we swap in all pages on a swap devcie being turned off. But in the case of shutdown that does not seem to make much sense. The userland should already be dead or, worst case, dying anyway. And there should not be anything that kernel depends on in pageable memory = at that late of the shutdown. That should definitely be true since we disabled swapping for kernel stacks. Not only such swapping in is unnecessary and can slow down shutdown process= , it can also cause a shutdown hang if the swapped memory size is large than the free memory size. Here is a stack trace demonstrating the problem: sched_switch+0x8c1 mi_switch+0xc1 _sleep+0x1f9 vm_wait_doms+0xe3 vm_wait_domain+0x47 vm_page_alloc_domain_after+0x228 vm_page_alloc+0x74 swapoff_one+0x33b swapoff_all+0x64 bufshutdown+0x2f8 kern_reboot+0x1a2 sys_reboot+0x336 amd64_syscall+0xed fast_syscall_common+0xf8 Messages seen on console: Waiting (max 60 seconds) for system process `vnlru' to stop... done Waiting (max 60 seconds) for system process `syncer' to stop...=20 Syncing disks, vnodes remaining... 0 0 0 0 0 done All buffers synced. swp_pager_getswapspace(32): failed --=20 You are receiving this mail because: You are the assignee for the bug.=