On Tue, Aug 09, 2022 at 09:12:57AM +0800, Yin Fengwei wrote: > Hi Yang, > > On 2022/8/9 01:49, Yang Shi wrote: > > The GFP_KERNEL is fine for most THP split callsites except for the > > memory reclaim path since it might not allow certain flags to avoid > > recursion, for example, nested reclaim, issue I/O, etc. The most > > filesystems clear __GFP_FS. However it should not be a real life > > problem now since AFAIK just xfs supports large folios for now and xfs > > uses iomap release_folio() method which actually ignores gfp flags. > Thanks a lot for the valuable comments. > > > > > > So it sounds safer to follow the gfp convention used by > > xas_split_alloc() in the below. The best way is to pass in the gfp > > flag from the reclaimer IMO, but it seems overkilling at the moment. > > It's possible that the gfp used by xas_split_alloc has __GFP_FS/IO set. > What about to use current_gfp_context(gfp_as_xas_split_alloc)? > Sounds reasonable to me. Also, the gfp used by xas_split_alloc() should also be modified to: current_gfp_context(mapping_gfp_mask(mapping) & GFP_RECLAIM_MASK)? Since they are in the same context.