Re: [PATCH] refcount: always allow checked forms

From: David Sterba
Date: Wed Jul 11 2018 - 13:37:13 EST


On Wed, Jul 11, 2018 at 06:49:46AM +0100, Mark Rutland wrote:
> > > Dave pointed out that it would be useful to be able to opt-in to full checks
> > > regardless of CONFIG_REFCOUNT_FULL, so that we can simplify callsites where we
> > > always want checks. I've spotted a few of these in code which is still awaiting
> > > conversion.
> >
> > The motivation was code like
> >
> > WARN_ON(refcount_read(&ref));
> > if (refcount_dec_and_test(&ref)) { ... }
> >
> > so the warning is redundant for REFCOUNT_FULL, but I'm going to use the
> > _checked versions everywhere the performance of refcounts is not
> > critical.
>
> If you will have conversion patches, do you want to pick this up as the start
> of a series?

The patches where I'd use the enhanced refcounts are nice-to-have and I
don't have an ETA so it would be better if the patch gets merged
independently. Thanks.