Re: [Report] annoyed dma debug warning "cacheline tracking EEXIST, overlapping mappings aren't supported"

From: Christoph Hellwig
Date: Tue Oct 15 2024 - 03:54:42 EST


On Tue, Oct 15, 2024 at 03:40:26PM +0800, Ming Lei wrote:
> > Yes, active_cacheline_insert only complains for FROM_DEVICE or
> > BIDIRECTIONAL mappings. I can't see how raid 1 would trigger that
> > given that it only reads from one leg at a time.
> >
> > Ming, can you look a bit more into what is happening here?
>
> All should be READ IO which is FROM_DEVICE, please see my reply:

Yes, reads translate to DMA_FROM_DEVICE.

> https://lore.kernel.org/linux-block/Zw3MZrK_l7DuFfFd@fedora/
>
> And the raid1 warning is actually from raid1_sync_request().

In that case the warnings are perfectly valid because the I/O patterns
will create data corruption on non-coherent architectures. For direct
I/O from userspace the kernel can't prevent it, but for raid1 we should
be able to do something better. As raid1_sync_request is a convoluted
and undocumented mess I don't have a straigh shot answer to what it is
doing (wrong) and how to fix it unfortunately.

>
>
> Thanks,
> Ming
---end quoted text---