Re: [PATCH 1/2] mm: Add memalloc_nowait_{save,restore}

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

 



On Mon, Aug 12, 2024 at 9:21 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Mon, Aug 12, 2024 at 08:59:53PM +0800, Yafang Shao wrote:
> >
> > I don’t see any incompatibility in __alloc_pages_slowpath(). The
> > ~__GFP_DIRECT_RECLAIM flag only ensures that direct reclaim is not
> > performed, but it doesn’t prevent the allocation of pages from
> > ALLOC_MIN_RESERVE, correct?
> >
> > > and thus will lead to kernel crashes.
> >
> > Could you please explain in detail where this might lead to kernel crashes?
>
> Sorry, I misread your patch as doing what your subject says.
> A nestable noreclaim is probably fine, but please name it that way,
> as memalloc_nowait_{save,restore} implies a context version
> of GFP_NOWAIT.

There are already memalloc_noreclaim_{save,restore} which imply __GFP_MEMALLOC:

  memalloc_noreclaim_save - Marks implicit __GFP_MEMALLOC scope.

That is why I name it memalloc_nowait_{save,restore}. GFP_NOWAIT has
the same meaning with ~__GFP_DIRECT_RECLAIM:

  %GFP_NOWAIT is for kernel allocations that should not stall for direct
  reclaim, start physical IO or use any filesystem callback.

-- 
Regards
Yafang





[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