Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jan 2007 10:56:09 -0800 (PST)
From:      Mohan Srinivasan <mohan_srinivasan@yahoo.com>
To:        Gleb Smirnoff <glebius@FreeBSD.org>, Mohan Srinivasan <mohans@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_mbuf.c src/sys/sys mbuf.h src/sys/vm uma.h uma_core.c
Message-ID:  <91560.391.qm@web30806.mail.mud.yahoo.com>
In-Reply-To: <20070125102921.GK4485@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Gleb,

Sorry. Lost power at home earlier this morning and was operating on very low
laptop battery power (and stealing network bandwidth from my neighbor over his
unsecured wireless network :)), so sent you a brief reply earlier.

We have this bit of logic in uma_zfree_arg()

/* See uma.h */
void
uma_zfree_arg(uma_zone_t zone, void *item, void *udata)
{
...
...
	/*
	 * The race here is acceptable.  If we miss it we'll just have to wait
	 * a little longer for the limits to be reset.
	 */
	if (keg->uk_flags & UMA_ZFLAG_FULL)
		goto zfree_internal;
...
...
zfree_internal:
	uma_zfree_internal(zone, item, udata, SKIP_DTOR, ZFREE_STATFREE);

	return;

And uma_zfree_internal() frees the object back to the slab and wakes up 
all blocked processes (one of which will proceed) and the others will 
reset ZFLAG_FULL and block. But as objects get freed, they should all 
get freed to the slab as long as ZFLAG_FULL is set, and blocked procs
woken up.

> P.S. Let me do a small style nit-pick. :) All the UMA public functions are
> preceeded with "uma_", so it will be more nice to create a public uma_zone_drain(),
> that just calls internal zone_drain(). Like uma_print_stats() or uma_zdestroy()
> are.

I'll do this.

thanks

mohan



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