From owner-freebsd-arch Wed Jan 22 14:54:22 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F9BC37B401 for ; Wed, 22 Jan 2003 14:54:21 -0800 (PST) Received: from tesla.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52BAB43F1E for ; Wed, 22 Jan 2003 14:54:20 -0800 (PST) (envelope-from bmilekic@unixdaemons.com) Received: (from bmilekic@localhost) by tesla.distributel.net (8.11.6/8.11.6) id h0MMu0g77489; Wed, 22 Jan 2003 17:56:00 -0500 (EST) (envelope-from bmilekic@unixdaemons.com) Date: Wed, 22 Jan 2003 17:56:00 -0500 From: Bosko Milekic To: Alfred Perlstein Cc: Andrew Gallatin , arch@FreeBSD.ORG Subject: Re: M_ flags summary. Message-ID: <20030122175600.A77460@unixdaemons.com> References: <20030122023246.GP42333@elvis.mu.org> <20030121224148.A75236@unixdaemons.com> <20030121.222025.101592442.imp@bsdimp.com> <20030122100253.A76397@unixdaemons.com> <0aef01c2c23d$0f1ae690$52557f42@errno.com> <20030122155457.A77036@unixdaemons.com> <15919.4208.394911.712558@grasshopper.cs.duke.edu> <20030122215424.GV42333@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030122215424.GV42333@elvis.mu.org>; from bright@mu.org on Wed, Jan 22, 2003 at 01:54:24PM -0800 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Jan 22, 2003 at 01:54:24PM -0800, Alfred Perlstein wrote: > * Andrew Gallatin [030122 13:43] wrote: > > > > The taste "problem" here is that it always used to be safe to sleep > > in a process context. That's not true anymore. Now its safe to > > sleep in a process context if you're not holding any mutexes. So > > there are pleny of sleepable allocation bugs lurking. > > > > If we want to catch sleepable allocation bugs right up front, I > > suggest we put this: > > > > if (!(flags & M_NOWAIT)) { > > WITNESS_SLEEP(1, NULL); > > } > > > > at the top of malloc, and at the top of all entry points to the mbuf > > allocator. Eg, before the system has a chance to pull the allocation > > off of some cache which will succeed 99.5% of the time, except when > > the system is under memory pressure. > > > > Sorry for dragging this in another direction.. > > This is actually a very good idea. It's too bad that one needs witness > to catch this though. Can you add it, or shall i do it tonight? It would be great if you did this for the mbuf code (the malloc() code apparently, as John points out, already does it). If anything, I think this is the one valuable thing we got out of this discussion. > -- > -Alfred Perlstein [alfred@freebsd.org] > 'Instead of asking why a piece of software is using "1970s technology," > start asking why software is ignoring 30 years of accumulated wisdom.' -- Bosko Milekic * bmilekic@unixdaemons.com * bmilekic@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message