vmalloc with GFP_NOFS

Michal Hocko mhocko at kernel.org
Wed Apr 25 07:45:57 PDT 2018


On Wed 25-04-18 08:43:32, Mikulas Patocka wrote:
> 
> 
> On Tue, 24 Apr 2018, Michal Hocko wrote:
> 
> > On Tue 24-04-18 19:17:12, Mikulas Patocka wrote:
> > > 
> > > 
> > > On Tue, 24 Apr 2018, Michal Hocko wrote:
> > > 
> > > > On Wed 25-04-18 00:18:40, Richard Weinberger wrote:
> > > > > Am Dienstag, 24. April 2018, 21:28:03 CEST schrieb Michal Hocko:
> > > > > > > Also only for debugging.
> > > > > > > Getting rid of vmalloc with GFP_NOFS in UBIFS is no big problem.
> > > > > > > I can prepare a patch.
> > > > > > 
> > > > > > Cool!
> > > > > > 
> > > > > > Anyway, if UBIFS has some reclaim recursion critical sections in general
> > > > > > it would be really great to have them documented and that is where the
> > > > > > scope api is really handy. Just add the scope and document what is the
> > > > > > recursion issue. This will help people reading the code as well. Ideally
> > > > > > there shouldn't be any explicit GFP_NOFS in the code.
> > > > > 
> > > > > So in a perfect world a filesystem calls memalloc_nofs_save/restore and
> > > > > always uses GFP_KERNEL for kmalloc/vmalloc?
> > > > 
> > > > Exactly! And in a dream world those memalloc_nofs_save act as a
> > > > documentation of the reclaim recursion documentation ;)
> > > > -- 
> > > > Michal Hocko
> > > > SUSE Labs
> > > 
> > > BTW. should memalloc_nofs_save and memalloc_noio_save be merged into just 
> > > one that prevents both I/O and FS recursion?
> > 
> > Why should FS usage stop IO altogether?
> 
> Because the IO may reach loop and loop may redirect it to the same 
> filesystem that is running under memalloc_nofs_save and deadlock.

So what is the difference with the current GFP_NOFS?

> > > memalloc_nofs_save allows submitting bios to I/O stack and the bios 
> > > created under memalloc_nofs_save could be sent to the loop device and the 
> > > loop device calls the filesystem...
> > 
> > Don't those use NOIO context?
> 
> What do you mean?

That the loop driver should make sure it will not recurse. The scope API
doesn't add anything new here.
-- 
Michal Hocko
SUSE Labs



More information about the linux-mtd mailing list