LWN: Comments on "Is it time to remove ZONE_DMA?" https://lwn.net/Articles/753273/ This is a special feed containing comments posted to the individual LWN article titled "Is it time to remove ZONE_DMA?". en-us Sat, 04 Oct 2025 04:20:54 +0000 Sat, 04 Oct 2025 04:20:54 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Is it time to remove ZONE_DMA? https://lwn.net/Articles/753698/ https://lwn.net/Articles/753698/ cborni <div class="FormattedComment"> <font class="QuotedText">&gt; By the way, the intended way for drivers to allocate memory below 2GB is the DMA allocation API with a mask of 1&lt;&lt;31 -1. Is that doable? </font><br> <p> No. This is not about driver code, this is about core code that calls some classic CISC instructions that require control blocks that might have some satellite blocks via pointers. And sometimes some specific satellite blocks need to be below 2GB.<br> <p> Another thing about dma mask: This does not keep this area free unless needed. GFP_DMA does that. <br> Imagine a system with 3 GB of memory.<br> 2GB ZONE_DMA<br> 1GB ZONE_NORMAL (or movable)<br> <p> <p> If the page cache now needs 2GB, it will consome the 1GB in ZONE_NORMAL and after that 1GB in ZONE_DMA. So we can still handle all DMA requests. If we have no dedicated zone then there is is higher chance that pages &lt;2GB are used making allocation in there less likely.<br> <p> So I think your understanding of ZONE_DMA usage (the x86 way) is not exactly how s390x uses it - I fear.<br> </div> Mon, 07 May 2018 17:04:52 +0000 Is it time to remove ZONE_DMA? https://lwn.net/Articles/753696/ https://lwn.net/Articles/753696/ cborni <div class="FormattedComment"> We need it to be below 2GB (the old 31bit mode has survived in some places).<br> Right now ZONE_DMA is defined to be exactly that on s390x. We could of course redefine everything to be GFP_DMA32 (which does not exist yet) but this seems a pointless rename.<br> </div> Mon, 07 May 2018 16:47:14 +0000 Is it time to remove ZONE_DMA? https://lwn.net/Articles/753692/ https://lwn.net/Articles/753692/ willy <div class="FormattedComment"> By the way, the intended way for drivers to allocate memory below 2GB is the DMA allocation API with a mask of 1&lt;&lt;31 -1. Is that doable? GFP_DMA might be used to implement that interface, but it's easier to deal with that than dozens of drivers.<br> </div> Mon, 07 May 2018 16:17:11 +0000 Is it time to remove ZONE_DMA? https://lwn.net/Articles/753691/ https://lwn.net/Articles/753691/ willy <div class="FormattedComment"> Can you use GFP_DMA32 for that purpose, or do you need it to refer to the full 4GB?<br> </div> Mon, 07 May 2018 16:13:50 +0000 Is it time to remove ZONE_DMA? https://lwn.net/Articles/753690/ https://lwn.net/Articles/753690/ timur <div class="FormattedComment"> On ARM, enabling DMA_CMA forces all DMA allocations to be made from the CMA, which means that if your CMA isn't big enough, you'll run out of memory. We've had to set the CMA size to 0 by default for our kernels, otherwise DMA allocations start to fail.<br> </div> Mon, 07 May 2018 16:04:22 +0000 Is it time to remove ZONE_DMA? https://lwn.net/Articles/753632/ https://lwn.net/Articles/753632/ cborni <div class="FormattedComment"> Unfortunately ZONE_DMA does not always mean the lowest 16MB.<br> On s390 we use GFP_DMA to allocate buffers below 2GB. This is still necessary for several hardware interfaces so we certainly need a way to allocate buffers in that region.<br> <p> </div> Mon, 07 May 2018 11:44:41 +0000 Is it time to remove ZONE_DMA? https://lwn.net/Articles/753627/ https://lwn.net/Articles/753627/ benh <div class="FormattedComment"> The PowerPC case isn't that simple ;-) We did have early PowerPC systems such as PReP machines, that did have ISA busses along with similar DMA limitations.<br> <p> On other systems, for a while became equiv. to ZONE_DMA32 at a time where the latter didn't exist yet.<br> <p> That said, I don't find many use in our code left these days, what did you spot that's still "wrong" in your opinion ?<br> <p> </div> Sun, 06 May 2018 23:18:00 +0000 Is it time to remove ZONE_DMA? https://lwn.net/Articles/753571/ https://lwn.net/Articles/753571/ arnd <div class="FormattedComment"> We also have a couple of ARM platforms, including IIRC the modern shmobile parts that use ZONE_DMA for various other platform specific limitations that are distinct from the 24 bit ISA bus constraints.<br> <p> CMA can probably work around most of those, but one would have to look not only at drivers that explicitly use GFP_DMA but also those that set a dma_mask smaller than 0xffffffff, either in the driver or inherited from the parent bus in DT.<br> </div> Fri, 04 May 2018 17:20:01 +0000