From: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
To: Hillf Danton <hdanton@sina.com>
Cc: Chris Goldsworthy <quic_cgoldswo@quicinc.com>,
Robin Murphy <robin.murphy@arm.com>,
<dave.hansen@linux.intel.com>, <bp@alien8.de>, <hpa@zytor.com>,
<hch@lst.de>, <m.szyprowski@samsung.com>,
<linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>,
<linux-kernel@vger.kernel.org>, <djakov@kernel.org>
Subject: Re: [RFC] mm: Allow ZONE_DMA32 to be disabled via kernel command line
Date: Tue, 31 Jan 2023 20:09:13 -0800 [thread overview]
Message-ID: <20230201040913.GA4959@hu-cgoldswo-sd.qualcomm.com> (raw)
In-Reply-To: <20230127085553.5120-1-hdanton@sina.com>
On Fri, Jan 27, 2023 at 04:55:53PM +0800, Hillf Danton wrote:
> On Thu, 26 Jan 2023 18:20:26 -0800 Chris Goldsworthy <quic_cgoldswo@quicinc.com>
> > On Thu, Jan 26, 2023 at 07:15:26PM +0000, Robin Murphy wrote:
> > > However, I'm just going to take a step back and read the commit message a
> > > few more times... Given what it claims, I can't help but ask why wouldn't we
> > > want a parameter to control kswapd's behaviour and address that issue
> > > directly, rather than a massive hammer that breaks everyone allocating
> > > explicitly or implicitly with __GFP_DMA32 (especially on systems where it
> > > doesn't normally matter because all memory is below 4GB anyway), just to
> > > achieve one rather niche side-effect?
> > >
> > > Thanks,
> > > Robin.
> >
> > Hi Robin,
> >
> > The commit text doesn't spell out the scenario we want to avoid, so I
> > will do that for clarity. We use a kernel binary compiled for us, and
> > by default has CONFIG_ZONE_DMA32 (and it can't be disabled for now as
> > another party needs it). Our higher-end SoCs are usually used with
> > 8-12 GB of DDR, so using a 12 GB device as an example, we would have 8
> > GB of ZONE_NORMAL memory and 4 GB of ZONE_MOVABLE memory with the
> > feature, and 4 GB of ZONE_DMA32, 4 GB of ZONE_NORMAL and 4 GB of
> > ZONE_MOVABLE otherwise.
> >
> > Without the feature enabled, consider a GFP_KERNEL allocation that
> > causes a low watermark beach in ZONE_NORMAL, such that such that
> > ZONE_DMA32 is almost full. This will cause kswapd to start reclaiming
> > memory, despite the fact that that we might have gigabytes of free
> > memory in ZONE_DMA32 that can be used by anyone (since GFP_MOVABLE and
> > GFP_NORMAL can fall back to using ZONE_DMA32).
>
> If kswapd is busy reclaiming pages even given gigabytes of free memory
> in the DMA32 zone then it is a CPU hog.
>
> Feel free to check pgdat_balanced() and prepare_kswapd_sleep().
Thanks for pointing out this gap in my understanding - I'm taking a closer look
at these paths to see whether there is room for what Robin suggested.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-02-01 4:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 16:43 [RFC] mm: Allow ZONE_DMA32 to be disabled via kernel command line Georgi Djakov
2023-01-26 18:51 ` Dave Hansen
2023-01-26 22:56 ` Georgi Djakov
2023-01-27 0:57 ` Randy Dunlap
2023-01-27 6:35 ` Christoph Hellwig
2023-01-27 6:52 ` H. Peter Anvin
2023-01-27 7:07 ` Christoph Hellwig
2023-01-26 19:15 ` Robin Murphy
2023-01-27 2:20 ` Chris Goldsworthy
2023-01-27 8:55 ` Hillf Danton
2023-02-01 4:09 ` Chris Goldsworthy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230201040913.GA4959@hu-cgoldswo-sd.qualcomm.com \
--to=quic_cgoldswo@quicinc.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=djakov@kernel.org \
--cc=hch@lst.de \
--cc=hdanton@sina.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox