From owner-cvs-all Thu May 2 15:23:38 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id D619A37B405 for ; Thu, 2 May 2002 15:23:32 -0700 (PDT) Received: (qmail 3552 invoked from network); 2 May 2002 22:23:31 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 2 May 2002 22:23:31 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g42MNTF09212; Thu, 2 May 2002 18:23:29 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <2397.1020368880@critter.freebsd.dk> Date: Thu, 02 May 2002 18:23:23 -0400 (EDT) From: John Baldwin To: Poul-Henning Kamp Subject: Re: cvs commit: src/sys/kern kern_malloc.c src/sys/vm uma_core.c Cc: Jeff Roberson , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Jeff Roberson Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 02-May-2002 Poul-Henning Kamp wrote: > In message , 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 <>< 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