Re: [PATCH] block: switch to atomic_t for request references

From: Jens Axboe
Date: Mon Dec 06 2021 - 13:13:25 EST


This is a multi-part message in MIME format.On 12/6/21 10:35 AM, Linus Torvalds wrote:
> On Mon, Dec 6, 2021 at 12:31 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>>
>> Quite; and for something that pretends to be about performance, it also
>> lacks any actual numbers to back that claim.
>>
>> The proposed implementation also doesn't do nearly as much as the
>> refcount_t one does.
>
> Stop pretending refcoutn_t is that great.
>
> It's horrid. The code it generators is disgusting. It should never
> have been inlines in the first place, and the design decsisions were
> questionable to begin with.
>
> There's a reason core stuff (like the page counters) DO NOT USE REFCOUNT_T.
>
> I seriously believe that refcount_t should be used for things like
> device reference counting or similar issues, and not for _any_ truly
> core code.

Maybe we just need to embrace it generically, took a quick stab at it
which is attached. Totally untested...

--
Jens Axboe