From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 9 23:48:04 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BF5116A41A for ; Wed, 9 Jan 2008 23:48:04 +0000 (UTC) (envelope-from bharmaji@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id B765C13C44B for ; Wed, 9 Jan 2008 23:48:03 +0000 (UTC) (envelope-from bharmaji@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so465263fgg.35 for ; Wed, 09 Jan 2008 15:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=p52KF3Qq51R2fmFRMEhvdUi+pWcfi81fd/TWzjVbki0=; b=KhEhu80BQmnur6PNeuh7ku3P01eTB6rnm2tfYncEK4TfXYafEuJfBcFeXxswvk0DEXXmXAF6h29hyzlcSLKYqIo5NR0t94xb6OIMl0Y7R9LCZLQG+Ny33fE4dWYZM9k3kEID9MxFvojgV3cwKDY0HhK/RwED+4xMWMNCmJ7kwHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=SbdiSlD3WLLa1tS2IkKphKtuCD+cAmWbbFcEqoGqqKuQXOBFr3OJq6rII3BBvYKkunoHjV4nUz+J62AokalfcTXysNfGsjK/z1XpPd/2fPAlaCEW+kyy+GxOQg29IIUdrNhMImIhbjjnkc/ONkPz+2IYxtV77YmHBEwRH0/+WCA= Received: by 10.78.132.2 with SMTP id f2mr1627199hud.44.1199922481964; Wed, 09 Jan 2008 15:48:01 -0800 (PST) Received: by 10.78.130.18 with HTTP; Wed, 9 Jan 2008 15:48:01 -0800 (PST) Message-ID: <67beabb0801091548p2b0bdf41m193a7a22c95411c4@mail.gmail.com> Date: Wed, 9 Jan 2008 15:48:01 -0800 From: "Bharma Ji" To: Mike , kris@freebsd.org In-Reply-To: <44b564930801090930y3ce2014bldaa7e97402683ef7@mail.gmail.com> MIME-Version: 1.0 References: <67beabb0801081555v4ca3b729x294322fa724afa09@mail.gmail.com> <4784159E.9040905@FreeBSD.org> <67beabb0801081925t67f995b8hc4cc779f88c2ba@mail.gmail.com> <66462bcb31fb347796200bd5260d7cdc@gmail.com> <47849E42.7090201@FreeBSD.org> <44b564930801090930y3ce2014bldaa7e97402683ef7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Graceful failure instead of panicking in kmem_malloc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2008 23:48:04 -0000 >Is there any way to make the system log and then gracefully shut off while >guaranteeing that the logging/shutdown procedure won't also run out memory >somewhere? For logging procedure, I am hoping that by keeping some memory aside, I should be able to guarantee that the procedure will not run out of memory. For shutdown, I don't know. I am not sure if doing the usual shutdown is even required. To me this appears to be a generic requirement of any system i.e. a) Set aside some memory to handle out of memory conditions. Establish a low threshold b) When the system reaches the low threshold, 1) stop all processing (not sure right now if this translates to shutdown) 2) record the error. Kris Thanks for sending the patch. The patch essentially will try to reclaim memory 8 times before panicking. Is the understanding correct? If so, how did you arrive at the number 8? On Jan 9, 2008 9:30 AM, Mike wrote: > Bharma Ji wrote: > > Is there any way to make the system log and then gracefully shut off > instead > > of panicking? > > Is there any way to make the system log and then gracefully shut off while > guaranteeing that the logging/shutdown procedure won't also run out memory > somewhere? >