Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1526855
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH 2/7] kref: Add kref_read() |
| Date | 2016-11-21 17:10 +0100 |
| Message-ID | <sFZkr-3oh-63@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <sEyFz-3CT-19@gated-at.bofh.it> <sEViN-1Hy-3@gated-at.bofh.it> <sFWcO-1f8-41@gated-at.bofh.it> <sFYRj-2Wx-3@gated-at.bofh.it> <sFZ0Z-2ZM-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Nov 21, 2016 at 04:49:15PM +0100, Peter Zijlstra wrote:
> > Speaking of non-fitting patterns. This one is quite common in
> > networking code for refcounters:
> >
> > if (atomic_cmpxchg(&cur->refcnt, 1, 0) == 1) {} This is from
> > net/netfilter/nfnetlink_acct.c, but there are similar ones in other
> > places.
>
> Cute, but weird it doesn't actually decrement if not 1.
Hurgh.. creative refcounting that. The question is how much of that do
we want to support? It really must not decrement there.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC][PATCH 2/7] kref: Add kref_read() Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-11-16 21:10 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() Peter Zijlstra <peterz@infradead.org> - 2016-11-17 10:00 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-11-17 18:30 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() Thomas Gleixner <tglx@linutronix.de> - 2016-11-17 18:30 +0100
RE: [RFC][PATCH 2/7] kref: Add kref_read() "Reshetova, Elena" <elena.reshetova@intel.com> - 2016-11-18 18:40 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-11-19 04:50 +0100
RE: [RFC][PATCH 2/7] kref: Add kref_read() "Reshetova, Elena" <elena.reshetova@intel.com> - 2016-11-21 09:20 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() David Windsor <dwindsor@gmail.com> - 2016-11-21 13:50 +0100
RE: [RFC][PATCH 2/7] kref: Add kref_read() "Reshetova, Elena" <elena.reshetova@intel.com> - 2016-11-21 16:40 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() Peter Zijlstra <peterz@infradead.org> - 2016-11-21 16:50 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() Peter Zijlstra <peterz@infradead.org> - 2016-11-21 17:10 +0100
RE: [RFC][PATCH 2/7] kref: Add kref_read() "Reshetova, Elena" <elena.reshetova@intel.com> - 2016-11-21 20:30 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() David Windsor <dwindsor@gmail.com> - 2016-11-21 21:20 +0100
Re: [RFC][PATCH 2/7] kref: Add kref_read() Peter Zijlstra <peterz@infradead.org> - 2016-11-22 11:40 +0100
csiph-web