From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Tue, 8 Dec 2009 11:36:34 -0500 To: 9fans@9fans.net Message-ID: <5d1347dfd611729cd82ac5bc0ca79c92@coraid.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] etherigbe.c using _xinc? Topicbox-Message-UUID: ac8a8a6a-ead5-11e9-9d60-3106f5b1d025 On Tue Dec 8 11:28:30 EST 2009, me@acm.jhu.edu wrote: > Hi, > > I noticed etherigbe.c (in igberballoc) was recently changed to > increment the refcount on the block it allocates. Any reason it uses > _xinc rather than incref? > > -- vs because it's not a Ref. unfortunately, if it were a Ref, it would be much faster. _xinc is deadly slow even if there is no contention on x86. i wish the ref counting had at least been isolated to the case that needs them. blocks in queues typically have one owner. so the owner of the block assumes it can modify the block whenever with no locking. ref counting means this assumption is false. i'm not sure how your supposed to wlock a block. - erik