Date: Thu, 2 May 2002 22:58:15 -0700 (PDT) From: Julian Elischer <julian@elischer.org> 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: <Pine.BSF.4.21.0205022256480.80897-100000@InterJet.elischer.org> In-Reply-To: <XFMail.20020502133400.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2 May 2002, John Baldwin wrote: > > 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). So just as M_NOWAIT should be discouraged (and > I've seen it used in places where it wasn't needed) holding locks across > malloc() should be highly discouraged, IMO. M_NOWAIT was done especially for this reason, (though of course in tho 'old' form of locks where slp() was teh lock-of-choice).. 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?Pine.BSF.4.21.0205022256480.80897-100000>