Re: [PATCH net v5 2/2] net/sched: cbs: use atomic64_t for idleslope and sendslope

From: Jack Wang

Date: Sat Dec 05 2026 - 08:09:09 EST



On Sat, 5 Dec 2026 13:22:22 +0200, Andy Shevchenko wrote:

> So, what's wrong with combining these two now?
>
> credits = q->credits + timediff_to_credits(now - q->last, idleslope);
>
> ...

Agree with that.

>
>> - credits = credits_from_len(len, q->sendslope,
>> + credits = credits_from_len(len, atomic64_read(&q->sendslope),
>> atomic64_read(&q->port_rate));
>
> And how does this help? Any value read by atomic APIs immediately becomes
> outdated (yes, by luck if not synchronised, it may keep the same value
> for a while).

This change is not meant for synchronization. The intent is to
prevent 64-bit load/store tearing on 32-bit architectures during
concurrent updates from cbs_change().

Thanks,
JW