Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 2001 19:44:28 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.ORG>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        arch@FreeBSD.ORG, Dag-Erling Smorgrav <des@ofug.org>
Subject:   Re: Second zone allocator patch
Message-ID:  <XFMail.010122194428.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0101221903190.27567-100000@besplex.bde.org>

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

On 22-Jan-01 Bruce Evans wrote:
>> http://people.freebsd.org/~des/software/vm_zone-20010122.diff
>> 
>> This replaces the simplelock in vm_zone with a mutex, and adds a
>> subsystem mutex that must be held when manipulating zlist (which is
>> now an SLIST).
> 
> The simplelock was a spinlock, so changing it to a lock that can sleep
> changes the semantics.  This seems to be a bug in the ZONE_INTERRUPT
> case -- note how the ZONE_INTERRUPT case of _zget() avoids locking
> stuff while the !ZONE_INTERRUPT case uses it.

Blocking on a mutex is allowed in an interrupt context, just sleeping via a cv,
or tsleep/msleep is prohibited, so using a normal mutex should be fine here. 
Note that it should still not call malloc() to avoid sleeping in the
ZONE_INTERRUPT case, however, it should lock in all cases.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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