From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753966Ab0HYONw (ORCPT ); Wed, 25 Aug 2010 10:13:52 -0400 Received: from casper.infradead.org ([85.118.1.10]:44471 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047Ab0HYONt convert rfc822-to-8bit (ORCPT ); Wed, 25 Aug 2010 10:13:49 -0400 Subject: Re: [patch 1/5] mm: add nofail variants of kmalloc kcalloc and kzalloc From: Peter Zijlstra To: "Ted Ts'o" Cc: David Rientjes , Jens Axboe , Andrew Morton , Neil Brown , Alasdair G Kergon , Chris Mason , Steven Whitehouse , Jan Kara , Frederic Weisbecker , "linux-raid@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , "cluster-devel@redhat.com" , "linux-ext4@vger.kernel.org" , "reiserfs-devel@vger.kernel.org" , "linux-kernel@vger.kernel.org" In-Reply-To: <20100825112433.GB4453@thunk.org> References: <1282656558.2605.2742.camel@laptop> <4C73CA24.3060707@fusionio.com> <20100825112433.GB4453@thunk.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Wed, 25 Aug 2010 16:13:20 +0200 Message-ID: <1282745600.2605.3751.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2010-08-25 at 07:24 -0400, Ted Ts'o wrote: > There are other places where we can fail safely (for example, in jbd's > start_this_handle, although that just pushes the layer up the stack, > and ultimately, to userspace where most userspace programs don't > really expect ENOMEM to get returned by a random disk write While talking with Chris about this, if you can indeed push the error out that far you can basically ensure this particular fs-op does not complicate the journal commit and thereby limit the number of extra entries in your journal, and thus the amount of memory required. So once stuff starts failing, push out ops back out of the filesystem code, force a journal commit, and then let these ops retry. There is no need to actually push the -ENOMEM all the way back to userspace.