Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2002 21:48:00 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Jeff Roberson <jeff@FreeBSD.org>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Jeff Roberson <jroberson@chesapeake.net>
Subject:   Re: cvs commit: src/sys/kern kern_malloc.c src/sys/vm uma_core.c 
Message-ID:  <2397.1020368880@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 02 May 2002 13:34:00 EDT." <XFMail.20020502133400.jhb@FreeBSD.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

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?2397.1020368880>