From owner-freebsd-arch Wed Jan 22 13:54:26 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 CD4CD37B401 for ; Wed, 22 Jan 2003 13:54:24 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7667C43F13 for ; Wed, 22 Jan 2003 13:54:24 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 58013AE2B7; Wed, 22 Jan 2003 13:54:24 -0800 (PST) Date: Wed, 22 Jan 2003 13:54:24 -0800 From: Alfred Perlstein To: Andrew Gallatin Cc: arch@FreeBSD.ORG Subject: Re: M_ flags summary. Message-ID: <20030122215424.GV42333@elvis.mu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15919.4208.394911.712558@grasshopper.cs.duke.edu> User-Agent: Mutt/1.4i 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 * 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? -- -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.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message