From nobody@FreeBSD.org  Sun Jan  4 10:02:07 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AE79E16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  4 Jan 2004 10:02:07 -0800 (PST)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1F6E243D66
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  4 Jan 2004 10:02:00 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i04I1xdL018718
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 4 Jan 2004 10:01:59 -0800 (PST)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.10/8.12.10/Submit) id i04I1xtB018717;
	Sun, 4 Jan 2004 10:01:59 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200401041801.i04I1xtB018717@www.freebsd.org>
Date: Sun, 4 Jan 2004 10:01:59 -0800 (PST)
From: Bastian Fuchs <bastiaf@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: During shutdown sync fails: "giving up on buffers"
X-Send-Pr-Version: www-2.0

>Number:         60900
>Category:       kern
>Synopsis:       During shutdown sync fails: "giving up on buffers"
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    truckman
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 04 10:10:13 PST 2004
>Closed-Date:    Fri Sep 16 03:17:34 GMT 2005
>Last-Modified:  Fri Sep 16 03:17:34 GMT 2005
>Originator:     Bastian Fuchs
>Release:        5.2-RC2 with 5.2-current Kernel
>Organization:
>Environment:
FreeBSD vulpec.lan.wg 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Sat Jan  3 01:53:08 CET 2004     root@vulpec.lan.wg:/usr/src/sys/i386/compile/VULPEC  i386
>Description:
During shutdown the buffer sync SOMETIMES fails with
syncing disks, buffers remaining... 55 55 55 55 55 (some times more, don't know exactly)
giving up on 55 buffers

I am using UFS2 for root and UFS2+SU for all other filesystems (/var, /tmp, /usr, /home).

The same problem exists with 5.1 and 5.1-current.
>How-To-Repeat:
The problem appears irregular on shutdowns.
>Fix:
      
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: truckman 
State-Changed-When: Wed Sep 7 00:47:41 GMT 2005 
State-Changed-Why:  
Fix committed in src/sys/kern/vfs_subr.c 1.503 and 1.504, which were 
included in 5.3-RELEASE. 

Awaiting confirmation of fix from PR submitter before closing PR. 


Responsible-Changed-From-To: freebsd-bugs->truckman 
Responsible-Changed-By: truckman 
Responsible-Changed-When: Wed Sep 7 00:47:41 GMT 2005 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=60900 
State-Changed-From-To: patched->closed 
State-Changed-By: truckman 
State-Changed-When: Fri Sep 16 03:05:15 GMT 2005 
State-Changed-Why:  
No feedback from PR submitter, but this problem should have been fixed 
before RELENG_5_BP and 5.3-RELEASE by these commits: 

truckman    2004-07-01 23:59:19 UTC 

FreeBSD src repository 

Modified files: 
sys/kern             vfs_subr.c  
Log: 
When shutting down the syncer kernel thread, first tell it to run 
faster and iterate to over its work list a few times in an attempt 
to empty the work list before the syncer terminates.  This leaves 
fewer dirty blocks to be written at the "syncing disks" stage and 
keeps the the "giving up on N buffers" problem from being triggered 
by the presence of a large soft updates work list at system shutdown 
time.  The downside is that the syncer takes noticeably longer to 
terminate. 

Tested by:      "Arjan van Leeuwen" <avleeuwen AT piwebs DOT com> 
Approved by:    mckusick 

Revision  Changes    Path 
1.495     +68 -6     src/sys/kern/vfs_subr.c 


truckman    2004-07-05 01:07:33 UTC 

FreeBSD src repository 

Modified files: 
sys/kern             vfs_subr.c  
Log: 
Rework syncer termination code: 

Speed up the syncer when shutting down by sleeping for a shorter 
period of time instead of cranking up rushjob and using the 
normal one second sleep. 

Skip empty worklist slots when shutting down to avoid lengthy 
intervals of inactivity. 

Give I/O more time to complete between steps by not speeding the 
syncer quite as much. 

Terminate the syncer after one full pass through the worklist 
plus one second with the worklist containing nothing but syncer 
vnodes. 

Print an indication of shutdown progress to the console. 

Add a sysctl, vfs.worklist_len, to allow the size of the syncer worklist 
to be monitored. 

Revision  Changes    Path 
1.503     +79 -33    src/sys/kern/vfs_subr.c 


truckman    2004-07-05 21:32:01 UTC 

FreeBSD src repository 

Modified files: 
sys/kern             vfs_subr.c  
Log: 
Unconditionally set last_work_seen while in the SYNCER_RUNNING state 
so that last_work_seen has a reasonable value at the transition 
to the SYNCER_SHUTTING_DOWN state, even if net_worklist_len happened 
to be zero at the time. 

Initialize last_work_seen to zero as a safety measure in case the 
syncer never ran in the SYNCER_RUNNING state. 

Tested by:      phk 

Revision  Changes    Path 
1.504     +4 -5      src/sys/kern/vfs_subr.c 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60900 
>Unformatted:
