Thread (36 messages) 36 messages, 6 authors, 2021-12-10

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

From: Peter Zijlstra <peterz@infradead.org>
Date: 2021-12-07 10:30:46
Also in: lkml

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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help