Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754373AbdCBQA2 (ORCPT ); Thu, 2 Mar 2017 11:00:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55306 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753161AbdCBQAY (ORCPT ); Thu, 2 Mar 2017 11:00:24 -0500 Date: Thu, 2 Mar 2017 10:59:41 -0500 From: Brian Foster To: Michal Hocko Cc: Christoph Hellwig , Tetsuo Handa , Xiong Zhou , linux-xfs@vger.kernel.org, linux-mm@kvack.org, LKML , linux-fsdevel@vger.kernel.org, Michal Hocko Subject: Re: [PATCH 2/2] xfs: back off from kmem_zalloc_greedy if the task is killed Message-ID: <20170302155941.GK3213@bfoster.bfoster> References: <20170302153002.GG3213@bfoster.bfoster> <20170302154541.16155-1-mhocko@kernel.org> <20170302154541.16155-2-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170302154541.16155-2-mhocko@kernel.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 Mar 2017 15:59:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 37 On Thu, Mar 02, 2017 at 04:45:41PM +0100, Michal Hocko wrote: > From: Michal Hocko > > It doesn't really make much sense to retry vmalloc request if the > current task is killed. We should rather bail out as soon as possible > and let it RIP as soon as possible. The current implementation of > vmalloc will fail anyway. > > Suggested-by: Brian Foster > Signed-off-by: Michal Hocko > --- Reviewed-by: Brian Foster > fs/xfs/kmem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/kmem.c b/fs/xfs/kmem.c > index ee95f5c6db45..01c52567a4ff 100644 > --- a/fs/xfs/kmem.c > +++ b/fs/xfs/kmem.c > @@ -34,7 +34,7 @@ kmem_zalloc_greedy(size_t *size, size_t minsize, size_t maxsize) > size_t kmsize = maxsize; > > while (!(ptr = vzalloc(kmsize))) { > - if (kmsize == minsize) > + if (kmsize == minsize || fatal_signal_pending(current)) > break; > if ((kmsize >>= 1) <= minsize) > kmsize = minsize; > -- > 2.11.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html