From owner-freebsd-bugs@freebsd.org Sun Jan 7 21:19:50 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B50E5E2B6 for ; Sun, 7 Jan 2018 21:19:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67B3879591 for ; Sun, 7 Jan 2018 21:19:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 4433821751 for ; Sun, 7 Jan 2018 21:19:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w07LJoNs006583 for ; Sun, 7 Jan 2018 21:19:50 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w07LJof5006582 for freebsd-bugs@FreeBSD.org; Sun, 7 Jan 2018 21:19:50 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: freebsd-bugs@FreeBSD.org Subject: =?UTF-8?B?W0J1ZyAyMjQ5NzVdIHNodXRkb3duKDgpIG5lZWRzIHRvIHdhaXQg?= =?UTF-8?B?bG9uZ2VyIGZvciBzd2Fwb2ZmIHRvIGF2b2lkIGEg4oCcQ2Fubm90IGFsbG9j?= =?UTF-8?B?YXRlIG1lbW9yeeKAnSBlcnJvcg==?= Date: Sun, 07 Jan 2018 21:19:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jilles@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2018 21:19:50 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224975 Jilles Tjoelker changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jilles@FreeBSD.org --- Comment #1 from Jilles Tjoelker --- Just "waiting for a few seconds" will not help. The order of operations wou= ld have to be adjusted. The current order is (incomplete): * shutdown(8) prints final warning message * shutdown(8) signals init(8) * init(8) sends SIGHUP to all /etc/ttys session leaders and revokes the terminals * init(8) starts rc.shutdown * rc.shutdown shuts down some daemons * rc.shutdown runs /etc/rc.d/swaplate, turning off swap with the late flag * rc.shutdown shuts down other daemons * init(8) revokes /dev/console * init(8) signals all processes with SIGTERM and then SIGKILL, waiting up = to 20 seconds for them to terminate * init(8) calls reboot(2) with appropriate arguments * kernel syncs * kernel unmounts (forcibly) all filesystems * kernel turns off all swap * kernel instructs hardware to power off, reboot, etc. As a result, any swap files must be turned off by /etc/rc.d/swaplate. If no= t, the kernel will panic when trying to read data from the swap file when turn= ing it off, since the filesystems have already been unmounted. You can make scenarios like yours work (without changes to FreeBSD) if you ensure the memory-eating processes are either shut down by an rc.d script t= hat runs before swaplate in the shutdown order or are in the foreground of a tty which is enabled in /etc/ttys. What could be done in FreeBSD is adding unforced unmount and swapoff after = all processes have been signaled. This could be in init(8) or the kernel. Some looping may be beneficial since turning off a swap file may make it possibl= e to unmount a filesystem without forcing. In case of swap on fuse or the like, it is necessary to turn off the swap before stopping the fuse daemon. However, it is best to kill as many proces= ses as possible before turning off swap to avoid paging in useless things and to avoid high memory pressure. --=20 You are receiving this mail because: You are the assignee for the bug.=