[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15137.1504306313@warthog.procyon.org.uk>
Date: Fri, 01 Sep 2017 23:51:53 +0100
From: David Howells <dhowells@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: dhowells@...hat.com, linux-afs@...ts.infradead.org,
linux-fsdevel@...r.kernel.org, Kees Cook <keescook@...omium.org>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 02/11] refcount: Implement inc/decrement-and-return functions
Peter Zijlstra <peterz@...radead.org> wrote:
> if (obj) {
> /* use obj */
> refcount_dec(&obj->refs); /* should never hit 0 */
> }
You've missed a bit: We need to tell the gc to run when we reduce the refcount
to 1:
if (obj) {
...
if (refcount_dec_return(&obj->refs) == 1)
schedule_gc();
}
David
Powered by blists - more mailing lists