DragonFly kernel List (threaded) for 2008-01
DragonFly BSD
DragonFly kernel List (threaded) for 2008-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: objcache depot not used?


From: "Nicolas Thery" <nthery@xxxxxxxxx>
Date: Mon, 28 Jan 2008 22:13:05 +0100

2008/1/28, Matthew Dillon <dillon@apollo.backplane.com>:
>     See line 536 or so of kern_objcache.c  What happens is that,
>     ultimately, a magazine will become completely full of free items.
>     (full magazine == completely full of items available for
>     allocation).
>
>     When the two per-cpu magazines become full one will be moved
>     to the depot and an empty magazine will be recycled from the
>     depot.

Um, I did some testing and I still don't get it.

One of the full magazine will be moved to the depot if and only if
there is an empty magazine in the depot in the first place:

    548 	/*
    549 	 * If an empty magazine is available in the depot, cycle it
    550 	 * through and retry.
    551 	 */
    552 	if (!SLIST_EMPTY(&depot->emptymagazines)) {


This does not seem to be the case (the depot is initially empty).  As a
consequence, the path taken is:

    578 	/*
    579 	 * An empty mag is not available.  This is a corner case which can
    580 	 * occur due to cpus holding partially full magazines.  Do not try
    581 	 * to allocate a mag, just free the object.
    582 	 */

As a further test, I allocated an empty mag in objcache_create() and stored
it in the depot (emptymagazines).  With this, the allocator behaves as you
describe.

Cheers,
Nicolas



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]