[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ya83zQRVUCRRYNHQ@hirez.programming.kicks-ass.net>
Date: Tue, 7 Dec 2021 11:30:37 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Kees Cook <keescook@...omium.org>, Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@...radead.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] block: switch to atomic_t for request references
On Mon, Dec 06, 2021 at 04:13:00PM -0800, Linus Torvalds wrote:
> IOW, I think that "try_get_page()" function is basically the *much*
> superior version of what is currently a broken "refcount_inc()".
>
> And yes, it does warn about that overflow case that you claim only
> refcount_t does. And does so without the broken semantics that
> refcount h as.
That places the burden of the unlikely overflow case on the user. Now
every driver author needs to consider the overflow case and have a
corresponding error path. How many bugs will that introduce?
Why is saturation; iow. leaking the memory, a worse option than having
bad/broken/never-tested error paths all over the kernel?
Powered by blists - more mailing lists