Re: [PATCH net-next v5 2/2] page_pool: Track DMA-mapped pages and unmap them when destroying the pool

Toke Høiland-Jørgensen
2025-04-01T09:20:19Z

Paolo Abeni <pabeni@redhat.com> writes:

> On 3/28/25 1:19 PM, Toke Høiland-Jørgensen wrote:
>> @@ -463,13 +462,21 @@ page_pool_dma_sync_for_device(const struct page_pool *pool,
>> netmem_ref netmem,
>> u32 dma_sync_size)
>> {
>> - if (pool->dma_sync && dma_dev_need_sync(pool->p.dev))
>> - __page_pool_dma_sync_for_device(pool, netmem, dma_sync_size);
>> + if (pool->dma_sync && dma_dev_need_sync(pool->p.dev)) {
>
> Lacking a READ_ONCE() here, I think it's within compiler's right do some
> unexpected optimization between this read and the next one. Also it will
> make the double read more explicit.

Right, good point; will respin!

-Toke