From owner-freebsd-current@freebsd.org Sun Apr 22 13:15:10 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 689B9F915C3 for ; Sun, 22 Apr 2018 13:15:10 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay116.isp.belgacom.be (mailrelay116.isp.belgacom.be [195.238.20.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C97BB6D21D; Sun, 22 Apr 2018 13:15:09 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AerQLsxUOoVfPZGb0Ysxp4S6wLUPV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYYxOCt8tkgFKBZ4jH8fUM07OQ7/i7HzRYqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRo?= =?us-ascii?q?LerpBIHSk9631+ev8JHPfglEnjWwba98IRmssQndqtQdjJd/JKo21hbHuGZDdf?= =?us-ascii?q?5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXM?= =?us-ascii?q?TRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmij?= =?us-ascii?q?oINyQh/W/ZisJ+kr9VrhGjqBxxzIHbfI6bOeFifq7fYd8WWXZNUtpPWyFHH4iy?= =?us-ascii?q?b5EPD+0EPetAsYf9plkOrR+jDgSyA+PvzSRIiWHz3aIg1eQhChzN0Qs8H9IPsn?= =?us-ascii?q?TUqM74OqcIUe+r0qbF0CjNYf1M1Tf68ojIfQksrPeRVrx+dsrRzFMgFwLDjliI?= =?us-ascii?q?p4zlJS2a2foWvGiA8uVsT+Wvi3Qoqwx3vzOhxd8sh5HKi44I0FzI6yp0zJsvKd?= =?us-ascii?q?GmVEJ3f8SoHIZQuiyUMYZ9X9ksTHtyuCkgz70LoZu7fC8Xx5s53xPfcPmHc5SQ?= =?us-ascii?q?4hLkSeaRPS90hHJ7d7K7gBa/6Uugxff4Vsm11VZFsDBFkt7WunAR1hzT6MyHRu?= =?us-ascii?q?Fh8Uem3jaPzB7c6uReLkAyjqrXMZkhwqQ/lpYLsETDGDH5mFnugaKVa0ko4Pak?= =?us-ascii?q?5uv6brn8uJOQK5F4hhvjPqkulMGzGeE4PRIPX2if9+S8zrrj/UjhTbVWj/02kK?= =?us-ascii?q?3ZvYvUJcQBuKG2HRRa0p0+5BqlCDemytsYkWEdLF1ZYBKHk5TpO1bWLfD7Cve/?= =?us-ascii?q?mEiskDZox//dILLhBo7ALnfGkLj7fLZ971RQxxY0zdBatNpoDeQiJ/ToRkb3qN?= =?us-ascii?q?3eRjU0Nwup2OH5QIF+0ZgCWGGFD6uxP6bbsFvO7eUqdbqifogQ7Qr8KfxtzPnp?= =?us-ascii?q?lnI8kFkGNf213JkTQF6iE/lMGGnfZmDj1IRSWVwWtxYzGbS5wGaJViReMi6/?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2BUHACEidxa/5nK8VFVBx4BHg2DKlMOe?= =?us-ascii?q?iiMSowXAQGBczEBXYZsjBQUgWQuhEgCgkQiNRcBAgEBAQEBAQIBaxwMgjUigkw?= =?us-ascii?q?BBTocIxALDgoJJQ8SGB4GE4R3AxkLqRiHBg2BK4IpBYofhBqCT0IEGIEvBBOFV?= =?us-ascii?q?AKXRywIhVyFZ4JyaItxiTZAh1weATWBUk0wCIJ+giAXiFmFQD0wAY4GKYIdAQE?= X-IPAS-Result: =?us-ascii?q?A2BUHACEidxa/5nK8VFVBx4BHg2DKlMOeiiMSowXAQGBczE?= =?us-ascii?q?BXYZsjBQUgWQuhEgCgkQiNRcBAgEBAQEBAQIBaxwMgjUigkwBBTocIxALDgoJJ?= =?us-ascii?q?Q8SGB4GE4R3AxkLqRiHBg2BK4IpBYofhBqCT0IEGIEvBBOFVAKXRywIhVyFZ4J?= =?us-ascii?q?yaItxiTZAh1weATWBUk0wCIJ+giAXiFmFQD0wAY4GKYIdAQE?= Received: from 153.202-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.202.153]) by relay.skynet.be with ESMTP; 22 Apr 2018 15:15:01 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w3MDF1Ai062374; Sun, 22 Apr 2018 15:15:01 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sun, 22 Apr 2018 15:15:00 +0200 From: Tijl Coosemans To: Konstantin Belousov Cc: jeff@FreeBSD.org, "freebsd-current@freebsd.org" Subject: Re: i386 hangs during halt "vnodes remaining... 0 time out" Message-ID: <20180422151500.1608af96@kalimero.tijl.coosemans.org> In-Reply-To: <20180422120521.GS6887@kib.kiev.ua> References: <20180421234934.10d7dfab@kalimero.tijl.coosemans.org> <20180422120521.GS6887@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 13:15:10 -0000 On Sun, 22 Apr 2018 15:05:21 +0300 Konstantin Belousov wrote: > On Sat, Apr 21, 2018 at 11:49:34PM +0200, Tijl Coosemans wrote: >> On Sat, 21 Apr 2018 21:09:09 +0000 Rick Macklem wrote: >>> With a recent head/current kernel (doesn't happen when running a Dec. >>> 2017 one), when I do a halt, it gets as far as: >>> >>> vnodes remaining... 0 time out >>> >>> and that's it (the time out appears several seconds after the first "0"). >>> With a Dec. 2017 kernel there would be several "0"s printed. >>> It appears that it is stuck in the first iteration of the sched_sync() >>> loop after it is no longer in SYNCER_RUNNING state. >>> >>> Any ideas? rick >> >> See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227404 >> I have a patch (attached) but haven't been able to test it yet. >> >> Index: sys/kern/vfs_bio.c >> =================================================================== >> --- sys/kern/vfs_bio.c (revision 332165) >> +++ sys/kern/vfs_bio.c (working copy) >> @@ -791,9 +791,12 @@ bufspace_daemon(void *arg) >> { >> struct bufdomain *bd; >> >> + EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown, curthread, >> + SHUTDOWN_PRI_LAST); >> + >> bd = arg; >> for (;;) { >> - kproc_suspend_check(curproc); >> + kthread_suspend_check(); >> >> /* >> * Free buffers from the clean queue until we meet our >> @@ -3357,7 +3360,7 @@ buf_daemon() >> /* >> * This process needs to be suspended prior to shutdown sync. >> */ >> - EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, bufdaemonproc, >> + EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown, curthread, >> SHUTDOWN_PRI_LAST); >> >> /* >> @@ -3381,7 +3384,7 @@ buf_daemon() >> bd_request = 0; >> mtx_unlock(&bdlock); >> >> - kproc_suspend_check(bufdaemonproc); >> + kthread_suspend_check(); >> >> /* >> * Save speedupreq for this pass and reset to capture new > This looks fine. Thanks for the review. There's just one concern I have. With this patch the bufspace_daemon threads appear to shutdown after the buf_daemon and after the syncer because the event handlers are registered later. Are there any dependencies between these processes that require the bufspace threads to be stopped earlier?