Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jun 2001 10:54:34 -0700 (PDT)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Ian Dowse <iedowse@maths.tcd.ie>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: UFS large directory performance 
Message-ID:  <200106021754.f52HsYR04024@earth.backplane.com>
References:   <200106021207.aa78407@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
    Oh yah, one more thing.  At risk of making the second level block
    more complex you might want to make a real structure out of it rather
    then a simple array.  Something like this:

    struct whateverYouNameTheSecondLevelBLock {
	short	use;
	char	filler[sizeof(void *) - sizeof(short)];
	secondLevel_t array[128];
    };

    We could maintain a use count on the second level block which
    would allow us to make better decisions on which one to reuse.

    You could get more complex and keep the second level blocks on
    their own LRU queue, making reclaims trivial.  This would require
    a doubly linked list node (lruq) and a backptr to allow you to
    unlink the second level block from the first level array, e.g.
    '*secondLevelBlock->backptr = (void *)-1;'

    struct whateverYouNameTheSecondLevelBLock {
	TAILQ_ENTRY(blah) lruq;
	firstLevel_t *backptr;
	short	use;
	char	filler[sizeof(void *) - sizeof(short)];
	secondLevel_t array[128];
    };

    For now I would recommend the first approach (you could add a queue node
    to the summary structure to allow scanning all the summary structures).
    This second approach would be a good second-round approach.

						-Matt

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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