From owner-freebsd-stable Tue Jan 8 13: 4:43 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mass.dis.org (dhcp45-21.dis.org [216.240.45.21]) by hub.freebsd.org (Postfix) with ESMTP id 5C9B037B41A; Tue, 8 Jan 2002 13:04:38 -0800 (PST) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.6/8.11.6) with ESMTP id g08L5D001648; Tue, 8 Jan 2002 13:05:14 -0800 (PST) (envelope-from msmith@mass.dis.org) Message-Id: <200201082105.g08L5D001648@mass.dis.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Poul-Henning Kamp Cc: Dan Moschuk , "M. Warner Losh" , msmith@FreeBSD.ORG, stable@FreeBSD.ORG Subject: Re: Hang in md driver In-reply-to: Your message of "Tue, 08 Jan 2002 21:50:00 +0100." <9566.1010523000@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 08 Jan 2002 13:05:13 -0800 From: Michael Smith Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > In message <20020108142747.G3163@spirit.jaded.net>, Dan Moschuk writes: > > > >| >In message: <200201072026.g07KQUX01267@mass.dis.org> > >| > Michael Smith writes: > >| >: This doesn't seem to address the problem; md(4) shouldn't hang when it > >| >: runs out of memory. > >| > > >| >We have systems that hange 1 time in 10 when booting when trying to > >| >mount the mfs stuff... :-( > >| > >| Well, there is no malloc_quota_used(9), so I can't do anything about it. > > > >What would be involved in writing one? Work has me pretty busy, but I'd > >like to take a stab at it. > > I have no idea, sorry... This wouldn't do it. You really want to add an M_SHORTWAIT flag, and in kern/kern_malloc.c around line 162 (in -current anyway) pass a timeout to msleep. If the timeout expires, return NULL. The wait should be perhaps 1 second at most. This would be simple to add to both -stable and -current, and since it doesn't change the behaviour of M_WAITOK, would not have any deleterious sideeffects. You could then work your way through the M_WAITOK consumers, teaching the relevant ones how to deal with resource starvation other than by deadlocking. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message