On Tue, Jun 03, 2025 at 03:15:03PM +0200, David Hildenbrand wrote:
On 30.05.25 22:29, Jiri Bohac wrote:
When re-using the CMA area for kdump there is a risk of pending DMA into
pinned user pages in the CMA area.
Pages that are pinned long-term are migrated away from CMA, so these are
not a concern. Pages pinned without FOLL_LONGTERM remain in the CMA and may
possibly be the source or destination of a pending DMA transfer.
I'll note that we right now do have an upstream BUG where that is sometimes
not the case. I mentioned it previously that such bugs will be a problem :(
https://lkml.kernel.org/r/20250523023709epcms1p236d4f55b79adb9366ec1cf6d5792b06b@epcms1p2
I'll just reitarate the whole purpose of this patchset, as
added to Documentation:
+static void crash_cma_clear_pending_dma(void)
+{
+ unsigned int s = cma_dma_timeout_sec;
+
+ if (!crashk_cma_cnt)
+ return;
+
+ while (s--)
+ mdelay(1000);
Any reason we cannot do it in a single mdelay() invocation?
mdelay() already is a loop around udelay on larger values IIUC.
No good reasons ;)
I just wanted to prevent a totally theoretical overflow (if cma_dma_timeout_sec was made configurable;
I also anticipated someone might want to add some progress printks into the cycle (without verifying if
that's even possible in this context).
If you want, I have no problem changing this to:
+ mdelay(cma_dma_timeout_sec * 1000);