Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932779AbdIFPJe (ORCPT ); Wed, 6 Sep 2017 11:09:34 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:35702 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932263AbdIFPJc (ORCPT ); Wed, 6 Sep 2017 11:09:32 -0400 X-Google-Smtp-Source: ADKCNb7+mPYMUcL5K6+/C2EboC+UWc2tIYZLuzTGQZdS8Sk/4wQAbT41HCmOIgHLPTW9zva1VIqYQw== Subject: Re: [PATCH 1/6] lightnvm: pblk: check for failed mempool alloc. To: Johannes Thumshirn , =?UTF-8?Q?Javier_Gonz=c3=a1lez?= Cc: mb@lightnvm.io, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= , =?UTF-8?Q?Matias_Bj=c3=b8rling?= References: <1504710066-4699-1-git-send-email-javier@cnexlabs.com> <1504710066-4699-2-git-send-email-javier@cnexlabs.com> <20170906150811.sa3vrrkbpv5rffeb@linux-x5ow.site> From: Jens Axboe Message-ID: Date: Wed, 6 Sep 2017 09:09:29 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170906150811.sa3vrrkbpv5rffeb@linux-x5ow.site> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 574 Lines: 13 On 09/06/2017 09:08 AM, Johannes Thumshirn wrote: > On Wed, Sep 06, 2017 at 05:01:01PM +0200, Javier González wrote: >> Check for failed mempool allocations and act accordingly. > > Are you sure it is needed? Quoting from mempool_alloc()s Documentation: > "[...] Note that due to preallocation, this function *never* fails when called > from process contexts. (it might fail if called from an IRQ context.) [...]" It's not needed, mempool() will never fail if __GFP_WAIT is set in the mask. The use case here is GFP_KERNEL, which does include __GFP_WAIT. -- Jens Axboe