Re: [PATCH] net: optimize cmpxchg in ip_idents_reserve

From: David Miller
Date: Thu Jan 16 2020 - 07:27:28 EST


From: Shaokun Zhang <zhangshaokun@xxxxxxxxxxxxx>
Date: Wed, 15 Jan 2020 11:23:40 +0800

> From: Yuqi Jin <jinyuqi@xxxxxxxxxx>
>
> atomic_try_cmpxchg is called instead of atomic_cmpxchg that can reduce
> the access number of the global variable @p_id in the loop. Let's
> optimize it for performance.
>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>
> Cc: Hideaki YOSHIFUJI <yoshfuji@xxxxxxxxxxxxxx>
> Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
> Cc: Yang Guo <guoyang2@xxxxxxxxxx>
> Signed-off-by: Yuqi Jin <jinyuqi@xxxxxxxxxx>
> Signed-off-by: Shaokun Zhang <zhangshaokun@xxxxxxxxxxxxx>

I doubt this makes any measurable improvement in performance.

If you can document a specific measurable improvement under
a useful set of circumstances for real usage, then put those
details into the commit message and resubmit.

Otherwise, I'm not applying this, sorry.