From owner-freebsd-current@FreeBSD.ORG Mon Jul 5 20:50:46 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A578B16A4CE; Mon, 5 Jul 2004 20:50:46 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D7E843D39; Mon, 5 Jul 2004 20:50:46 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i65KoiZs005048; Mon, 5 Jul 2004 22:50:44 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Don Lewis From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 05 Jul 2004 13:45:31 PDT." <200407052045.i65KjVfo002006@gw.catspoiler.org> Date: Mon, 05 Jul 2004 22:50:44 +0200 Message-ID: <5047.1089060644@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: current@FreeBSD.org Subject: Re: current syncer bug... X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Mon, 05 Jul 2004 20:50:46 -0000 Works for me too. In message <200407052045.i65KjVfo002006@gw.catspoiler.org>, Don Lewis writes: >On 5 Jul, Poul-Henning Kamp wrote: >> In message <200407052006.i65K6Lrf001926@gw.catspoiler.org>, Don Lewis writes: >>>On 5 Jul, Poul-Henning Kamp wrote: >>>> >>>> Waiting (max 60 seconds) for system process `vnlru' to stop...stopped >>>> Waiting (max 60 seconds) for system process `bufdaemon' to stop...stopped >>>> Waiting (max 60 seconds) for system process `syncer' to stop...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>> >>>Interesting ... >>> >>>Does it ever print "stopped", or does it hit the 60 second timeout? >> >> Dunno, havn't waited that long. >> >> This is a diskless system which boots single-user to run a test, there's >> never a R/w mount done. > >I can reproduce this here by booting into single-user mode and then >rebooting. At least it does time out after 60 seconds and let the >shutdown continue. > >The following patch works for me (and fixes another bug): > >Index: sys/kern/vfs_subr.c >=================================================================== >RCS file: /home/ncvs/src/sys/kern/vfs_subr.c,v >retrieving revision 1.503 >diff -u -r1.503 vfs_subr.c >--- sys/kern/vfs_subr.c 5 Jul 2004 01:07:33 -0000 1.503 >+++ sys/kern/vfs_subr.c 5 Jul 2004 20:43:23 -0000 >@@ -1531,7 +1531,7 @@ > int syncer_final_iter; > > mtx_lock(&Giant); >- last_work_seen = -1; >+ last_work_seen = 0; > syncer_final_iter = 0; > syncer_state = SYNCER_RUNNING; > starttime = time_second; >@@ -1585,11 +1585,10 @@ > * Return to the SHUTTING_DOWN state if any > * new work appears. > */ >- if (net_worklist_len > 0) { >+ if (net_worklist_len > 0 || syncer_state == SYNCER_RUNNING) > last_work_seen = syncer_delayno; >- if (syncer_state == SYNCER_FINAL_DELAY) >- syncer_state = SYNCER_SHUTTING_DOWN; >- } >+ if (net_worklist_len > 0 && syncer_state == SYNCER_FINAL_DELAY) >+ syncer_state = SYNCER_SHUTTING_DOWN; > while ((vp = LIST_FIRST(slp)) != NULL) { > if (VOP_ISLOCKED(vp, NULL) != 0 || > vn_start_write(vp, &mp, V_NOWAIT) != 0) { > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.