what is fsck's "slowdown"?

Marc G. Fournier scrappy at hub.org
Fri Sep 3 20:32:08 PDT 2004


Long shot here, but is this a change that could be MFC'd to 4.x?  Or has 
fsck changed so much since that it could only be done in 5.x?

I just finished another 12hr fsck run *sigh*

On Fri, 3 Sep 2004, Don Lewis wrote:

> On  4 Sep, Giorgos Keramidas wrote:
>> On 2004-09-03 14:58, Don Lewis <truckman at freebsd.org> wrote:
>
>>> Using two CPUs would give you at best a 2x speedup, and in this case it
>>> would be quite a bit less since both CPUs would be trying to access and
>>> modify the same data structure.  Just using a better data structure is
>>> likely to speed things up much more than 2x.  Something as simple as
>>> building the list in reverse order in pass 1 is likely to make a huge
>>> difference.
>>
>> Holding both a head and tail pointer to the singly-linked list should
>> probably make it easier to add nodes at the end of the list instead of
>> the head.  I haven't read the source of fsck_ffs at all though, so I
>> don't know if I can come up with a working patch in a reasonable amount
>> of time.
>
> Yes, if fsck used the <sys/queue.h> macros, this data structure should
> probably be a STAILQ.  The code if fsck is all hand rolled and it would
> be trivially easy to add a tail pointer.  The head of the list in
> question is
> 	struct zlncnt *zlnhead;
> The only modifications needed would be in the initialization code in
> main.c, and the code that builds the list in pass1.c.
>
>
>

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy at hub.org           Yahoo!: yscrappy              ICQ: 7615664


More information about the freebsd-current mailing list