From owner-freebsd-hackers Sat Jun 2 10:54:40 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id B5C4337B43E for ; Sat, 2 Jun 2001 10:54:36 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.3/8.11.2) id f52HsYR04024; Sat, 2 Jun 2001 10:54:34 -0700 (PDT) (envelope-from dillon) Date: Sat, 2 Jun 2001 10:54:34 -0700 (PDT) From: Matt Dillon Message-Id: <200106021754.f52HsYR04024@earth.backplane.com> To: Ian Dowse Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: UFS large directory performance References: <200106021207.aa78407@salmon.maths.tcd.ie> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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