From owner-freebsd-current@freebsd.org Sat Apr 21 22:28:02 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 2916DFA9338 for ; Sat, 21 Apr 2018 22:28:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE2A87415; Sat, 21 Apr 2018 22:28:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id A0z1fGPOhbrv9A0z3fmjQo; Sat, 21 Apr 2018 16:27:54 -0600 X-Authority-Analysis: v=2.3 cv=JOMVTfCb c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=YqRfAJJkAAAA:8 a=hF2rLc1pAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=q1TktWUj2a0_YGXEua8A:9 a=CjuIK1q_8ugA:10 a=EZxYlxVqKW1-bC4Rwo9g:22 a=O9OM7dhJW_8Hj9EqqvKN:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id AC4D83AB; Sat, 21 Apr 2018 15:27:51 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w3LMRpbI002978; Sat, 21 Apr 2018 15:27:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w3LMRp5W002975; Sat, 21 Apr 2018 15:27:51 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804212227.w3LMRp5W002975@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Tijl Coosemans cc: Rick Macklem , "freebsd-current@freebsd.org" Subject: Re: i386 hangs during halt "vnodes remaining... 0 time out" In-Reply-To: Message from Tijl Coosemans of "Sat, 21 Apr 2018 23:49:34 +0200." <20180421234934.10d7dfab@kalimero.tijl.coosemans.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 21 Apr 2018 15:27:51 -0700 X-CMAE-Envelope: MS4wfJfZHhyktM/YDhxHzLfthdcO375tYHHfhDxf43mUMRjvc6vVT85AYlrrP+ix1+kjPK7LKQdvm/K027jbGA4QoFSKr/EYgn1rzDf9Ua1wM207ZjU8efgg H2RIjXGkKztdn1s68h/2fS1hgf1oDydGkrmX0oLSWjOzKeCFavRSps+Dkylx7gbAO3YfltDKDWIVuZqmuw8InYx+wqnJJyCZUWnlTg/3fQkwsFS+475TC6/1 z2/hS0VDldAoZAsEzouVGQ== 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: Sat, 21 Apr 2018 22:28:02 -0000 In message <20180421234934.10d7dfab@kalimero.tijl.coosemans.org>, Tijl Cooseman s writes: > --MP_/TDsO+CDIra7UXGs=vVO3NTB > Content-Type: text/plain; charset=US-ASCII > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > 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. I've noticed this as well on my old Penium-M laptop (updated about twice a year). I'll try your patch this weekend or early next week. ~cy > > --MP_/TDsO+CDIra7UXGs=vVO3NTB > Content-Type: text/x-patch > Content-Transfer-Encoding: 7bit > Content-Disposition: attachment; filename=bufdaemon.patch > > 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 > > --MP_/TDsO+CDIra7UXGs=vVO3NTB > Content-Type: text/plain; charset="us-ascii" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > --MP_/TDsO+CDIra7UXGs=vVO3NTB-- > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.