# Re: \[PATCH net-next v2 2/3\] page\_pool: Turn dma\_sync and dma\_sync\_cpu fields into a bitmap

- From: Toke Høiland-Jørgensen \<hidden\>
- Date: 2025-03-26 08:12:49 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/03/6537250
- Thread: https://ratatoskr.run/netdev/2025/03/6537241/t.md

```text
Jakub Kicinski [ref] writes:

> On Tue, 25 Mar 2025 16:45:43 +0100 Toke Høiland-Jørgensen wrote:
>> Change the single-bit booleans for dma_sync into an unsigned long with
>> BIT() definitions so that a subsequent patch can write them both with a
>> singe WRITE_ONCE() on teardown. Also move the check for the sync_cpu
>> side into __page_pool_dma_sync_for_cpu() so it can be disabled for
>> non-netmem providers as well.
>
> Can we make them just bools without the bit width?
> Less churn and actually fewer bytes.

Ah! Didn't realise that was possible, excellent solution :)

> I don't see why we'd need to wipe them atomically.
> In fact I don't see why we're touching dma_sync_cpu, at all,
> it's driver-facing and the driver is gone in the problematic
> scenario.

No you're right, but it felt weird to change just one of them, so
figured I'd go with both. But keeping them both as bool, and just making
dma_sync a full-width bool works, so I'll respin with that and leave
dma_sync_cpu as-is.

```
