Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Nov 1999 09:52:55 -0500 (EST)
From:      Bosko Milekic <bmilekic@dsuper.net>
To:        Julian Elischer <julian@whistle.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: mbuf wait code (revisited) -- review?
Message-ID:  <Pine.OSF.4.05.9911180943360.28163-100000@oracle.dsuper.net>
In-Reply-To: <Pine.BSF.4.10.9911120009110.17452-100000@current1.whistle.com>

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

Although I've presently received little feedback on this...

I found a potential problem with the patch, so I am taking the following
approach to bypass it. I have a feeling that there's another way, though
(perhaps better, conceptually).

Consider a case where there are 40 instances of tsleep all waiting for an mbuf
to be freed. Consider a single mbuf beeing freed, this would awake _all_ the
sleepers, the first one "queued" would succeed in the [retried] MGET whereas the
other 39 will fail and return NULL (not necessarily having waited the designated
mbuf_wait time).

I am replacing the wakeup() in the wakeup procedure with a wakeup_one and adding
an extra 'check' to the sleep procedures themselves. Thus, when the 'free' macro
is used, the wakeup procedure is called, one sleep (the first one) is woken up,
it tries the MGET, hopefully succeeds, and if it does, checks whether or not
there are more free mbufs -- if that's the case, then another wakeup_one is
done, etc. Note that the statement to zero out the number of 'waiting' instances
in the wakeup function would be replaced by a decrement of that count.

This approach adds some overhead (not much, though). Anybody know of a different
[better] way?

On Fri, 12 Nov 1999, Julian Elischer wrote:

!>It looks pretty thorough but needs more examination that I have given it
!>yet.
!>
!>On Fri, 12 Nov 1999, Bosko Milekic wrote:
!>
!>> 
!>> Hi,
!>> 
!>> 	Attached are some diffs that provide a couple of wait routines in the
!>> out-of-mbuf and/or out-of-mbuf-cluster case(s). The attached diffs are for -STABLE
!>> and I would be greatful if somebody could review them/give feedback. I have diffs for
!>> -CURRENT but am not posting them because I haven't had too much of a chance to test
!>[...]
!>
!>
!>
!>To Unsubscribe: send mail to majordomo@FreeBSD.org
!>with "unsubscribe freebsd-hackers" in the body of the message
!>


--
 Bosko Milekic <bmilekic@technokratis.com>





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?Pine.OSF.4.05.9911180943360.28163-100000>