NetBSD Problem Report #11989

Received: (qmail 8702 invoked from network); 18 Jan 2001 14:02:31 -0000
Message-Id: <20010118140229.EC710D20B@hydra.hamachi.org>
Date: Thu, 18 Jan 2001 09:02:29 -0500 (EST)
From: sommerfeld@hamachi.org
Reply-To: sommerfeld@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: raidframe disk geometry pessimizes ffs layout
X-Send-Pr-Version: 3.95

>Number:         11989
>Category:       kern
>Synopsis:       raidframe disk geometry pessimizes ffs layout
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 18 14:03:00 +0000 2001
>Closed-Date:    Tue Mar 30 02:50:00 +0000 2004
>Last-Modified:  Tue Mar 30 02:50:00 +0000 2004
>Originator:     Bill Sommerfeld
>Release:        20010116
>Organization:
	hah
>Environment:

System: NetBSD hydra.hamachi.org 1.5Q NetBSD 1.5Q (HYDRA) #3: Tue Jan 9 22:33:17 EST 2001 sommerfeld@snoop:/usr/smpsys/arch/i386/compile/HYDRA i386
Architecture: i386
Machine: i386
>Description:

sys/dev/raidframe/rf_netbsdkintf.c constructs a fabricated label for
the raid device with geometry as follows:

	/* fabricate a label... */
	lp->d_nsectors = raidPtr->Layout.dataSectorsPerStripe;
	lp->d_ntracks = 1;
	lp->d_ncylinders = raidPtr->totalSectors / 
		(lp->d_nsectors * lp->d_ntracks);

This means "too many cylinders, too few tracks", which tricks newfs
into making very large numbers of very small cylinder groups, which
causes severe problems under certain workloads (see kern/11983).  In
short, when there are significant numbers of files which are around
the size of a cylinder group or larger, then cylinder groups tend to
fill, which causes allocations which prefer those cylinder groups to
spend a lot of time hunting for free blocks.

While the fix to ffs_dirpref() for kern/11983 will alleviate some of
the pain, overall system performance will still suffer because
individual cylinder groups will be more likely to be completely full.

>How-To-Repeat:
	see kern/11983

>Fix:

Se larger value for ntracks, and correspondingly smaller value for ncylinders.

first thing which comes to mind is:

	raid.d_nsectors = component.d_nsectors
	raid.d_ntracks = component.d_ntracks * N
	raid.d_ncylinders = component.d_ncylinders

(N here is "number of disk's worth of real data", which appears to be
"Layout.numDataCol")

however, because of how ffs does its layout, a cylinder really should
be to be an integral number of stripes long.  

perhaps:
	estcyl = component.d_ncylinders
	estcylsize = totalsize / estcyl

	stripepercyl = (estcylsize+sectorsperstripe-1)/sectorsperstripe

	nsectors = sectorsperstripe
	ntracks = stripepercyl
	cylinders = totalsectors / (nsectors * ntracks)

sample values from two raids i have set up:

	4 disks of 168x20x5273 in raid 5, stripe unit of 128

	totalsize = 53320572
	estcyl = 5273
	estcylsize = 10111
	stripepercyl = 79
	nsectors = 128
	ntracks = 79
	ncylinders = 5272

(vs 128/1/138855)

	3 disks of 184/5/6810 in raid 5, stripe unit of 32

	estcyl = 6810
	estcylsize = 922
	stripepercyl = 29
	nsectors = 64
	ntracks = 29
	ncylinders = 6769

(vs 64/1/196306)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: bouyer 
State-Changed-When: Fri Aug 2 07:32:22 PDT 2002 
State-Changed-Why:  
Default geometry of raidframe has been changed. Does it work for you ? 

From: "Perry E. Metzger" <perry@piermont.com>
To: sommerfeld@hamachi.org
Cc: gnats-bugs@gnats.netbsd.org, perry@piermont.com, bouyer@netbsd.org,
  oster@netbsd.org
Subject: Re: kern/11989
Date: 05 Apr 2003 15:11:40 -0500

 >Synopsis:       raidframe disk geometry pessimizes ffs layout

 According to a note added to this PR on Aug. 2, 2002, the default
 geometry of Raidframe has been changed.

 Could you check if this change is sufficient to allow us to close the
 PR? It has been open for some years now.

 Perry

From: David Laight <david@l8s.co.uk>
To: gnats-bugs@gnats.netbsd.org
Cc: sommerfeld@netbsd.org, perry@netbsd.org
Subject: re: kern/11989: raidframe disk geometry pessimizes ffs layout
Date: Sun, 10 Aug 2003 11:50:22 +0100

 Additionally newfs has been (recently) changed to ignore the (reported)
 physical geometry and always create a small number of full 'cylinder
 groups' which it tells the FS code have only one cylinder in them.

 	David

 -- 
 David Laight: david@l8s.co.uk

State-Changed-From-To: feedback->closed 
State-Changed-By: fair 
State-Changed-When: Tue Mar 30 02:48:37 UTC 2004 
State-Changed-Why:  

Conversation on ICB with Greg Oster indicates the 
pessimal value of n_tracks = 1 has been changed to 
n_tracks = num_columns * 4, so this problem should 
be resolved for now. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.