Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2012 16:12:32 -0800
From:      Kirk McKusick <mckusick@mckusick.com>
To:        Sergey Kandaurov <pluknet@gmail.com>
Cc:        Greg 'groggy' Lehey <grog@freebsd.org>, freebsd-fs@freebsd.org, Dieter BSD <dieterbsd@engineer.com>
Subject:   Re: FFS - Still using rotational delay with modern disks? 
Message-ID:  <201212180012.qBI0CW0c098207@chez.mckusick.com>
In-Reply-To: <CAE-mSOJGXWGp%2B=GPLyA3NjLGnqXNj9eiQ1_%2B2X7oNkGSnrHpuw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Tue, 18 Dec 2012 02:56:49 +0300
> Subject: Re: FFS - Still using rotational delay with modern disks?
> From: Sergey Kandaurov <pluknet@gmail.com>
> To: "Greg 'groggy' Lehey" <grog@freebsd.org>
> Cc: freebsd-fs@freebsd.org, freebsd-performance@freebsd.org,
>         Dieter BSD <dieterbsd@engineer.com>
> 
> On 18 December 2012 03:23, Greg 'groggy' Lehey <grog@freebsd.org> wrote:
> > On Monday, 17 December 2012 at 16:44:11 -0500, Dieter BSD wrote:
> >> The newfs man page says:
> >>
> >>  -a maxcontig
> >>  Specify the maximum number of contiguous blocks that will be laid
> >>  out before forcing a rotational delay.  The default value is 16.
> >>  See tunefs(8) for more details on how to set this option.
> >>
> >> Is this still a good idea with modern drives where the number of
> >> sectors per track varies, and no one but the manufacturer knows how
> >> many sectors a particular track has?
> >
> > No.
> >
> > It looks as if this, and also a number of comments in sys/ufs/ffs/fs.h
> > and sys/ufs/ffs/ffs_alloc.c, are leftovers from the Olden Days.  The
> > value isn't used anywhere that I can see.  Unless somebody can show
> > that I'm wrong, I'd suggest that this is a documentation issue that I
> > can take a look at.
> 
> [performance@ list trimmed]
> 
> I'm not sure about this.
> In UFS fs_maxcontig controls fs_contigsumsize during newfs, both saved
> in superblock, and fs_contigsumsize is widely used throughout FFS.
> 
>         sblock.fs_maxcontig = maxcontig;
>         if (sblock.fs_maxcontig < sblock.fs_maxbsize / sblock.fs_bsize) {
>                 sblock.fs_maxcontig = sblock.fs_maxbsize / sblock.fs_bsize;
>                 printf("Maxcontig raised to %d\n", sblock.fs_maxbsize);
>         }
>         if (sblock.fs_maxcontig > 1)
>                 sblock.fs_contigsumsize = MIN(sblock.fs_maxcontig,FS_MAXCONTIG);
> 
> 
> For ext2 this is instead "reconstructed" in the in-memory sblock copy
> in mountfs().
> 
>         /*
>          * Calculate the maximum contiguous blocks and size of cluster summary
>          * array.  In FFS this is done by newfs; however, the superblock
>          * in ext2fs doesn't have these variables, so we can calculate
>          * them here.
>          */
>         ump->um_e2fs->e2fs_maxcontig = MAX(1, MAXPHYS /
> 	    ump->um_e2fs->e2fs_bsize);
>         if (ump->um_e2fs->e2fs_maxcontig > 0)
>                 ump->um_e2fs->e2fs_contigsumsize =
>                     MIN(ump->um_e2fs->e2fs_maxcontig, EXT2_MAXCONTIG);
>         else
>                 ump->um_e2fs->e2fs_contigsumsize = 0;
> 
> -- 
> wbr,
> pluknet

Maxcontig is still in the filesystem. However, it is generally overridden
(i.e., ignored) when clustering and dynamic block reallocation are in
effect which they are by default and have been since some time early in
the 1990's.

	Kirk McKusick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212180012.qBI0CW0c098207>