Re: [PATCH v2 1/2] cxgb4: sched: Use refcount_t for refcount

From: Willem de Bruijn
Date: Fri Aug 02 2019 - 09:40:34 EST


On Fri, Aug 2, 2019 at 4:36 AM Chuhong Yuan <hslester96@xxxxxxxxx> wrote:
>
> refcount_t is better for reference counters since its
> implementation can prevent overflows.
> So convert atomic_t ref counters to refcount_t.
>
> Signed-off-by: Chuhong Yuan <hslester96@xxxxxxxxx>
> ---
> Changes in v2:
> - Convert refcount from 0-base to 1-base.

This changes the initial value from 0 to 1, but does not change the
release condition. So this introduces an accounting bug?