Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1657241

Re: [lkp-robot] [btrfs] beeeccca9b: WARNING:at_mm/util.c:#kvmalloc_node

From Stephen Rothwell <sfr@canb.auug.org.au>
Newsgroups linux.kernel
Subject Re: [lkp-robot] [btrfs] beeeccca9b: WARNING:at_mm/util.c:#kvmalloc_node
Date 2017-06-05 05:40 +0200
Message-ID <tOR22-5Sy-15@gated-at.bofh.it> (permalink)
References (1 earlier) <tN5LQ-1k9-19@gated-at.bofh.it> <tN7Xk-2RF-21@gated-at.bofh.it> <tN7Xk-2RF-19@gated-at.bofh.it> <tN870-2UY-25@gated-at.bofh.it> <tNdgm-6b3-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi David,

On Wed, 31 May 2017 16:58:48 +0200 David Sterba <dsterba@suse.cz> 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?

-- 
Cheers,
Stephen Rothwell

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node Michal Hocko <mhocko@kernel.org> - 2017-05-31 09:00 +0200
  Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node Michal Hocko <mhocko@kernel.org> - 2017-05-31 11:20 +0200
    Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node Omar Sandoval <osandov@osandov.com> - 2017-05-31 11:30 +0200
      Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node Michal Hocko <mhocko@kernel.org> - 2017-05-31 12:40 +0200
      Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node David Sterba <dsterba@suse.cz> - 2017-05-31 17:00 +0200
        Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node Stephen Rothwell <sfr@canb.auug.org.au> - 2017-06-05 05:40 +0200
          Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node David Sterba <dsterba@suse.cz> - 2017-06-05 13:50 +0200
            Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node Stephen Rothwell <sfr@canb.auug.org.au> - 2017-06-05 14:20 +0200
  Re: [lkp-robot] [btrfs]  beeeccca9b:  WARNING:at_mm/util.c:#kvmalloc_node Omar Sandoval <osandov@osandov.com> - 2017-05-31 11:20 +0200

csiph-web