[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240903120840.GD424729@mit.edu>
Date: Tue, 3 Sep 2024 08:08:40 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: Zhaoyang Huang <huangzhaoyang@...il.com>
Cc: "zhaoyang.huang" <zhaoyang.huang@...soc.com>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org,
steve.kang@...soc.com
Subject: Re: [RFC PATCHv2 1/1] fs: ext4: Don't use CMA for buffer_head
On Tue, Sep 03, 2024 at 04:50:46PM +0800, Zhaoyang Huang wrote:
> > I'd also sugest only trying to use this is the file system has
> > journaling enabled. If the file system is an ext2 file system without
> > a journal, there's no reason avoid using the CMA region
> agree.
> > assume the reason why the buffer cache is trying to use the moveable
> > flag is because the amount of non-CMA memory might be a precious
> > resource in some systems.
>
> I don't think so. All migrate type page blocks possess the same
> position as each other as they could fallback to all migrate types
> when current fails. I guess the purpose could be to enlarge the scope
> of available memory as __GFP_MOVEABLE has the capability of recruiting
> CMA.
Well, I guess I'm a bit confused why the buffer cache is trying to use
__GFP_MOVEABLE in the first place. In general CMA is to allow systems
to be able to allocate big chunks of memory which have to be
physically contiguous because the I/O device(s) are too primitive to
be able to do scatter-gather, right? So why are we trying to use CMA
eligible memory for 4k buffer cache pages? Presumably, because
there's not enough non-CMA eligible memory?
After all, using GFP_MOVEABLE memory seems to mean that the buffer
cache might get thrashed a lot by having a lot of cached disk buffers
getting ejected from memory to try to make room for some contiguous
frame buffer memory, which means extra I/O overhead. So what's the
upside of using GFP_MOVEABLE for the buffer cache?
Just curious, because in general I'm blessed by not having to use CMA
in the first place (not having I/O devices too primitive so they can't
do scatter-gather :-). So I don't tend to use CMA, and obviously I'm
missing some of the design considerations behind CMA. I thought in
general CMA tends to used in early boot to allocate things like frame
buffers, and after that CMA doesn't tend to get used at all? That's
clearly not the case for you, apparently?
Cheers,
- Ted
Powered by blists - more mailing lists