[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180504163826.GR12217@hirez.programming.kicks-ass.net>
Date: Fri, 4 May 2018 18:38:26 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
linux-kernel@...r.kernel.org, tglx@...utronix.de,
Ingo Molnar <mingo@...hat.com>, linux-mm@...ck.org,
Shaohua Li <shli@...nel.org>, linux-raid@...r.kernel.org
Subject: Re: Introduce atomic_dec_and_lock_irqsave()
On Fri, May 04, 2018 at 05:26:40PM +0100, Al Viro wrote:
> 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:
> >
> > > 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...
Yeah, I should've remembered, I tried to convert that once ;-) i_count is
a usage count, not a refcount.
Powered by blists - more mailing lists