xfs-masters
[Top] [All Lists]

Re: [PATCH 0/6] Handle bio_alloc failure

To: Nikanth Karthikesan <knikanth@xxxxxxx>
Subject: Re: [PATCH 0/6] Handle bio_alloc failure
From: Theodore Tso <tytso@xxxxxxx>
Date: Tue, 14 Apr 2009 14:16:32 -0400
Cc: Jens Axboe <jens.axboe@xxxxxxxxxx>, Neil Brown <neilb@xxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Chris Mason <chris.mason@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Dave Kleikamp <shaggy@xxxxxxxxxxxxxx>, xfs-masters@xxxxxxxxxxx
In-reply-to: <200904141711.20378.knikanth@xxxxxxx>
Mail-followup-to: Theodore Tso <tytso@xxxxxxx>, Nikanth Karthikesan <knikanth@xxxxxxx>, Jens Axboe <jens.axboe@xxxxxxxxxx>, Neil Brown <neilb@xxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Chris Mason <chris.mason@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Dave Kleikamp <shaggy@xxxxxxxxxxxxxx>, xfs-masters@xxxxxxxxxxx
References: <200904141636.26557.knikanth@xxxxxxxxxx> <20090414111838.GG5178@xxxxxxxxx> <200904141711.20378.knikanth@xxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Tue, Apr 14, 2009 at 05:11:19PM +0530, Nikanth Karthikesan wrote:
> On Tuesday 14 April 2009 16:48:38 Jens Axboe wrote:
> >
> > It will not fail as long as __GFP_WAIT is set, which it is for all 6 of
> > your patches.

Um, before we take out the checks, can we please make sure this is a
guaranteed, documented behaviour?  In include/linux/page_alloc.h,
__GFP_NOFAIL is documented as "will never fail", but it says
absolutely nothing about __GFP_WAIT.

Some day, someone will create a static checker that will flag warnings
when people fail to check for allocation failures, and it would be
good if the formal semantics for __GFP_WAIT, and hence for GFP_NOFS,
GFP_KERNEL, and GFP_USER, et. al. are defined.

We have code in fs/jbd2/transaction.c that calls kzalloc with
GFP_NOFS|__GFP_NOFAIL, since I and many other people had the
assumption that without __GFP_NOFAIL, an GFP_NOFS allocation could
very well fail.

Or is this special-case behaviour which bio_alloc() guarantees, but
not necessarily any other allocation function?

                                        - Ted

<Prev in Thread] Current Thread [Next in Thread>