Re: [RFC 1/3] mm/vmalloc: alloc GFP_NO{FS,IO} for vmalloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 19-10-21 11:44:01, Neil Brown wrote:
> On Mon, 18 Oct 2021, Michal Hocko wrote:
[...]
> > @@ -2930,8 +2932,24 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
> >  		goto fail;
> >  	}
> >  
> > -	if (vmap_pages_range(addr, addr + size, prot, area->pages,
> > -			page_shift) < 0) {
> > +	/*
> > +	 * page tables allocations ignore external gfp mask, enforce it
> > +	 * by the scope API
> > +	 */
> > +	if ((gfp_mask & (__GFP_FS | __GFP_IO)) == __GFP_IO)
> > +		flags = memalloc_nofs_save();
> > +	else if (!(gfp_mask & (__GFP_FS | __GFP_IO)))
> 
> I would *much* rather this were written
> 
>         else if ((gfp_mask & (__GFP_FS | __GFP_IO)) == 0)

Sure, this looks better indeed.

> so that the comparison with the previous test is more obvious.  Ditto
> for similar code below.
> It could even be
> 
>    switch (gfp_mask & (__GFP_FS | __GFP_IO)) {
>    case __GFP__IO: flags = memalloc_nofs_save(); break;
>    case 0:         flags = memalloc_noio_save(); break;
>    }
> 
> But I'm not completely convinced that is an improvement.

I am not a great fan of this though.

> In terms of functionality this looks good.

Thanks for the review!

-- 
Michal Hocko
SUSE Labs



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux