From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbdJCOgW (ORCPT ); Tue, 3 Oct 2017 10:36:22 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:47320 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752161AbdJCOgU (ORCPT ); Tue, 3 Oct 2017 10:36:20 -0400 X-Google-Smtp-Source: AOwi7QCGy0PCYJVBb3cxnBPJPHPPdl6FHObxlC7CVpSLV1o0LFh1uO2809R6i9P/e7T+KkUiN9Bb4w== Subject: Re: [PATCH 02/12] buffer: grow_dev_page() should use __GFP_NOFAIL for all cases To: Jan Kara Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, hannes@cmpxchg.org, torvalds@linux-foundation.org References: <1506543239-31470-1-git-send-email-axboe@kernel.dk> <1506543239-31470-3-git-send-email-axboe@kernel.dk> <20171003121049.GJ11879@quack2.suse.cz> <20171003122559.GL11879@quack2.suse.cz> From: Jens Axboe Message-ID: Date: Tue, 3 Oct 2017 08:36:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171003122559.GL11879@quack2.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/03/2017 06:25 AM, Jan Kara wrote: > On Tue 03-10-17 14:10:49, Jan Kara wrote: >> On Wed 27-09-17 14:13:49, Jens Axboe wrote: >>> We currently it it for find_or_create_page(), which means that it >>> cannot fail. Ensure we also pass in 'retry == true' to >>> alloc_page_buffers(), which also ensure that it cannot fail. >>> >>> After this, there are no failure cases in grow_dev_page() that >>> occur because of a failed memory allocation. >>> >>> Signed-off-by: Jens Axboe >> >> Makes sense. You can add: >> >> Reviewed-by: Jan Kara > > I forgot one question though: > >>> page = find_or_create_page(inode->i_mapping, index, gfp_mask); >>> - if (!page) >>> - return ret; > > Are we sure find_or_create_page() cannot fail for other reasons than > ENOMEM? Currently it seems to be the case AFAICT but it isn't obvious to me > that is guaranteed in future as well... It looks up a page, or allocates and adds one. If we tell the allocator that we cannot tolerate failure, then I don't see what else would be able to make it fail. That function is such an integral part of lookup/create for the page cache. -- Jens Axboe