vinum start config disk thrashing

Matthew Dillon dillon at
Sat Jul 8 19:28:10 PDT 2006

:I noticed that a "start" in vinum results in quite heavy disk thrasing he=
:re.  I found out why:
:- start results in a "read /dev/ad0 /dev/ad4"
:- read tries all slices and partitions therein
:- each try opens the partition
:- each opening of a partition results in the kernel re-scanning all slice=
: tables and disklabels
:so this means for each of my ntfs slices and for my bsd partitions the ke=
:rnel will read all slice tables (including extended slices) and all diskl=
:abels, which is quite a lot.
:why don't we cache this information until it is invalidated or something?=
:  how would we do that?  I found this comment in kern/subr_diskslice.c:ds=
:        /*=20
:         * XXX reinitialize the slice table unless there is an open devic=
:         * on the unit.  This should only be done if the media has change=
:         */
:and that's obviously the problem.
:  simon
    This is a little hairy, because two things can happen:  First, a
    program like disklabel or fdisk might open a disk and modify the
    slice or partition table.  Second, media might change out from
    under the kernel.

    Also, opening the raw disk (e.g. /dev/da0) no longer tries to
    scan anything (nor should it), so we can't open the raw disk and
    hold it open while we scan the rest.

    I'm not sure that we want to try to cache the information when
    nobody has it open, because of #2 above.

    Or, alternatively, we could cache the information for up to N
    ticks (e.g like one second) after the last close.  That might
    work ok.


More information about the Kernel mailing list