RE: [PATCH v2] dma-mapping: fix dma_addressing_limited if dma_range_map can't cover all system RAM

From: Justin He
Date: Tue Oct 10 2023 - 04:43:11 EST


Hi Christoph,

> -----Original Message-----
> From: Christoph Hellwig <hch@xxxxxx>
> Sent: Tuesday, October 10, 2023 3:48 PM
> To: Justin He <Justin.He@xxxxxxx>
> Cc: Christoph Hellwig <hch@xxxxxx>; Marek Szyprowski
> <m.szyprowski@xxxxxxxxxxx>; Robin Murphy <Robin.Murphy@xxxxxxx>;
> iommu@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2] dma-mapping: fix dma_addressing_limited if
> dma_range_map can't cover all system RAM
>
> dma_addressing_limited is called for every dma (direct) map, and this new
> code is way to heavy for that. We'll need to cache the information somehow.
Yes, maybe a flag is needed to set to true once the heavy work is done.
Hence, the flag should be set to false when the SYSTEM RAM resources are changed.
Let me check all the cases.


--
Cheers,
Justin (Jia He)