NetBSD Problem Report #18972

Received: (qmail 18850 invoked by uid 605); 8 Nov 2002 16:54:12 -0000
Message-Id: <>
Date: Sat, 09 Nov 2002 01:24:22 +0900
Subject: LFS DIROPs should take account of nbuf
X-Send-Pr-Version: 3.95

>Number:         18972
>Category:       kern
>Synopsis:       LFS DIROPs should take account of nbuf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    yamt
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 08 16:55:01 +0000 2002
>Last-Modified:  Mon Jul 05 05:15:23 +0000 2004
>Originator:     YAMAMOTO Takashi <>
>Release:        NetBSD 1.6K


System: NetBSD kaeru 1.6K NetBSD 1.6K (build.kaeru) #170: Sat Nov 9 00:41:22 JST 2002 takashi@kaeru:/usr/home/takashi/work/kernel/build.kaeru i386
Architecture: i386
Machine: i386
	LFS doesn't care about nbuf when processing inodes with IN_ADIROP.
	so buf starvation occurs with many DIROPs and the system locks up.

	set kern.maxvnodes high value and set nbuf low value.
	then do many DIROPs. (eg. create/remove large directory trees.)
	I don't think following patch is so correct,
	but it makes my pc less unstable.

Index: lfs.h
RCS file: /cvs/NetBSD/syssrc/sys/ufs/lfs/lfs.h,v
retrieving revision 1.41
diff -u -p -r1.41 lfs.h
--- lfs.h	2002/07/06 01:30:11	1.41
+++ lfs.h	2002/11/08 16:15:01
@@ -92,7 +92,7 @@
 #define BW_CLEAN	1
 #define MIN_FREE_SEGS	2
 #define LFS_MAX_ACTIVE	10
-#define LFS_MAXDIROP	(desiredvnodes >> 2)
+#define LFS_MAXDIROP	MIN(desiredvnodes >> 2, nbuf >> 2)
 # define LFS_ATIME_IFILE 0

From: YAMAMOTO Takashi <>
Subject: pr/18972 CVS commit: src/sys/ufs
Date: Thu, 26 Dec 2002 15:37:22 +0200 (EET)

 Module Name:	src
 Committed By:	yamt
 Date:		Thu Dec 26 13:37:21 UTC 2002

 Modified Files:
 	src/sys/ufs/lfs: lfs_bio.c lfs_vnops.c
 	src/sys/ufs/ufs: ufs_readwrite.c

 Log Message:
 - in lfs_reserve, reserve locked buffer count as well.
 - don't wait for locking buf in lfs_bwrite_ext to avoid deadlocks.
 - skip lfs_reserve when we're doing dirop.
   reserve more (for lfs_truncate) in set_dirop instead.

 this mostly solves PR 18972. (and hopefully PR 19196)

 To generate a diff of this commit:
 cvs rdiff -r1.50 -r1.51 src/sys/ufs/lfs/lfs_bio.c
 cvs rdiff -r1.69 -r1.70 src/sys/ufs/lfs/lfs_vnops.c
 cvs rdiff -r1.44 -r1.45 src/sys/ufs/ufs/ufs_readwrite.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback 
State-Changed-By: tls 
State-Changed-When: Wed Mar 31 07:07:59 UTC 2004 
Is this fixed, as the commit message suggests? 

Responsible-Changed-From-To: kern-bug-people->yamt 
Responsible-Changed-By: tls 
Responsible-Changed-When: Wed Mar 31 07:07:59 UTC 2004 
yamt's a developer; he gets to own his own bug. :-) 
State-Changed-From-To: feedback->analyzed 
State-Changed-By: yamt 
State-Changed-When: Mon Jul 5 05:14:11 UTC 2004 


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.