Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2002 18:23:23 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Jeff Roberson <jroberson@chesapeake.net>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Jeff Roberson <jeff@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/kern kern_malloc.c src/sys/vm uma_core.c
Message-ID:  <XFMail.20020502182323.jhb@FreeBSD.org>
In-Reply-To: <2397.1020368880@critter.freebsd.dk>

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

On 02-May-2002 Poul-Henning Kamp wrote:
> In message <XFMail.20020502133400.jhb@FreeBSD.org>, John Baldwin writes:
> 
> 
>>So I should amend: it should probably be ok to hold locks if M_NOWAIT is
>>used.  However, we should avoid holding locks for "long" periods of time.
>>Esp. around non-relevant stuff like malloc (doing a malloc() usually isn't
>>very relevant to the consistency of the data structure, you should almost
>>always be able to make the structure consistent somehow, drop the lock,
>>malloc, then lock and make the change, or just malloc first before getting
>>locks and making changes).
> 
> Well, for locks involving single data structures this might be true,
> but for locks which protect larger sets of data structures integrity
> this may just be plain impossible.

I'm not sure that is true.  The kernel already lives through possibly
blocking in malloc(), so that code probably is usually safe the way it
is already on 4.x.  Either that or it's buggy.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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




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