Thread (14 messages) 14 messages, 3 authors, 2018-06-04

Re: Introduce atomic_dec_and_lock_irqsave()

From: Al Viro <viro@ZenIV.linux.org.uk>
Date: 2018-05-04 16:26:47
Also in: linux-mm, lkml

On Fri, May 04, 2018 at 06:21:02PM +0200, Peter Zijlstra wrote:
On Fri, May 04, 2018 at 06:07:26PM +0200, Sebastian Andrzej Siewior wrote:
quoted
do you intend to kill refcount_dec_and_lock() in the longterm?
You meant to say atomic_dec_and_lock() ? Dunno if we ever get there, but
typically dec_and_lock is fairly refcounty, but I suppose it is possible
to have !refcount users, in which case we're eternally stuck with it.
Yes, there are - consider e.g.

void iput(struct inode *inode)
{ 
        if (!inode)
                return;
        BUG_ON(inode->i_state & I_CLEAR);
retry:
        if (atomic_dec_and_lock(&inode->i_count, &inode->i_lock)) {

inode->i_count sure as hell isn't refcount_t fodder...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help