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: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Jan 2008 20:21:12 -0800 (PST)

: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

    Hmm. I haven't looked at this code in a long time, but I think you're
    right.  I don't see any empty mags in the depot either.  Doh!

    Ok.  Well, I think your fix is correct.  Go ahead and spuce it up and
    post it.

    The objcache_put() path cannot allocate a magazine without potentially
    deadlocking the memory subsystem so we want to supply an initial number
    of empty magazines to the depot as in your test.  The question is, how
    many should we throw in there?   We Probably want some hysteresis on the
    backing store so we could do something like:

	n = 0;
	if (cluster_limit > 0)
		n = (cluster_limit - ncpus * 2 * mag_capacity) / mag_capacity;
	if (n < 2)
		n = 2;	/* minimum, also handles unlimited case */

    What do you think?

					Matthew Dillon 

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