Re: [PATCH] refcount: introduce refcount_is_one() helper function

From: yajun . deng
Date: Thu Nov 18 2021 - 05:35:39 EST


November 18, 2021 4:44 PM, "Peter Zijlstra" <peterz@xxxxxxxxxxxxx> wrote:

> On Thu, Nov 18, 2021 at 08:12:56AM +0000, yajun.deng@xxxxxxxxx wrote:
>
>> November 18, 2021 3:42 PM, "Peter Zijlstra" <peterz@xxxxxxxxxxxxx> wrote:
>>
>> On Thu, Nov 18, 2021 at 11:53:28AM +0800, Yajun Deng wrote:
>>
>> There are many cases where it is necessary to determine if refcount is one,
>> introduce refcount_is_one() helper function for these cases.
>>
>> Give me one that is not racy?
>>
>> The following determine refcount is one, 35 count.
>
> Very good, now get me one that isn't broken :-)

Sorry, I didn't understand what is the 'isn't broken'。