From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbdFELoM (ORCPT ); Mon, 5 Jun 2017 07:44:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:41378 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751290AbdFELoK (ORCPT ); Mon, 5 Jun 2017 07:44:10 -0400 Date: Mon, 5 Jun 2017 13:43:06 +0200 From: David Sterba To: Stephen Rothwell Cc: Omar Sandoval , Michal Hocko , lkp@01.org, Omar Sandoval , Vinnie Magro , kernel test robot , LKML Subject: Re: [lkp-robot] [btrfs] beeeccca9b: WARNING:at_mm/util.c:#kvmalloc_node Message-ID: <20170605114306.GR12135@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Stephen Rothwell , Omar Sandoval , Michal Hocko , lkp@01.org, Omar Sandoval , Vinnie Magro , kernel test robot , LKML References: <20170531063033.GC1795@yexl-desktop> <20170531065128.GB3853@dhcp22.suse.cz> <20170531091202.GA769@vader> <20170531091904.GD27783@dhcp22.suse.cz> <20170531092920.GA1418@vader> <20170531145848.GB12135@suse.cz> <20170605133023.57a82e4d@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170605133023.57a82e4d@canb.auug.org.au> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 05, 2017 at 01:30:23PM +1000, Stephen Rothwell wrote: > Hi David, > > On Wed, 31 May 2017 16:58:48 +0200 David Sterba wrote: > > > > On Wed, May 31, 2017 at 02:29:20AM -0700, Omar Sandoval wrote: > > > diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c > > > index fc0bd8406758..5abd3cd71144 100644 > > > --- a/fs/btrfs/free-space-tree.c > > > +++ b/fs/btrfs/free-space-tree.c > > > @@ -153,21 +153,18 @@ static inline u32 free_space_bitmap_size(u64 size, u32 sectorsize) > > > > > > static u8 *alloc_bitmap(u32 bitmap_size) > > > { > > > - void *mem; > > > + u8 *ret; > > > + unsigned int nofs_flag; > > > > > > /* > > > - * The allocation size varies, observed numbers were < 4K up to 16K. > > > - * Using vmalloc unconditionally would be too heavy, we'll try > > > - * contiguous allocations first. > > > + * GFP_NOFS doesn't work with kvmalloc(), but we really can't recurse > > > + * into the filesystem as the free space bitmap can be modified in the > > > + * critical section of a transaction commit. > > > */ > > > - if (bitmap_size <= PAGE_SIZE) > > > - return kzalloc(bitmap_size, GFP_NOFS); > > > - > > > - mem = kzalloc(bitmap_size, GFP_NOFS | __GFP_NOWARN); > > > - if (mem) > > > - return mem; > > > - > > > - return __vmalloc(bitmap_size, GFP_NOFS | __GFP_ZERO, PAGE_KERNEL); > > > + nofs_flag = memalloc_nofs_save(); > > > + ret = kvmalloc(bitmap_size, GFP_KERNEL); > > > + memalloc_nofs_restore(nofs_flag); > > > + return ret; > > > } > > > > > > int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, > > > > > > Dave, would you prefer to replace the patch we have now or do an > > > incremental patch on top of it? > > > > I'll drop the patch "btrfs: Use kvzalloc instead of kzalloc/vmalloc in > > alloc_bitmap", please send an updated version. > > Ping? Now fixed, sorry. Top commit 736202ae51c50a6063087011073e91b6a6ae92e9. I didn't notice the patch got back to for-next through another branch.