Discussion:
mbuf: atomic_inc_uint
(too old to reply)
Christoph Egger
2010-11-24 14:02:39 UTC
Permalink
Hi!

Is there a reason to not use atomic_inc_uint
in sys/kern/uipc_mbuf.c:m_ext_free(), line 1560 ?

Christoph

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Antti Kantee
2010-11-24 14:30:39 UTC
Permalink
Post by Christoph Egger
Hi!
Is there a reason to not use atomic_inc_uint
in sys/kern/uipc_mbuf.c:m_ext_free(), line 1560 ?
Is there any reason to use it? The comment claims you're dropping the
last reference, so assuming the comment is true, there is no way another
thread could be mucking with the refcounter. It looks like the increment
just serves the purpose of being able to reuse the m_ext_free() interface.

(also notice the non-interlocked ext_refcnt == 1 check / adjustment above)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...