Re: [patch 06/11] posix-timers: Make signal_struct::next_posix_timer_id an atomic_t
From: Eric Dumazet
Date: Mon Feb 24 2025 - 08:35:34 EST
On Mon, Feb 24, 2025 at 2:20 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Mon, Feb 24, 2025 at 11:15:32AM +0100, Thomas Gleixner wrote:
>
> > + unsigned int id = (atomic_inc_return(&sig->next_posix_timer_id) - 1) & INT_MAX;
>
> How about:
>
> unsigned int id = atomic_fetch_inc(&sig->next_posix_timer_id) & INT_MAX;
NIce, it seems few calls in net trees could use this as well.