Received: with ECARTIS (v1.0.0; list netdev); Tue, 05 Apr 2005 13:14:25 -0700 (PDT) Received: from cheetah.davemloft.net (mail@dsl027-180-174.sfo1.dsl.speakeasy.net [216.27.180.174]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j35KEJxe022030 for ; Tue, 5 Apr 2005 13:14:19 -0700 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1DIuPz-0005QN-00; Tue, 05 Apr 2005 13:12:59 -0700 Date: Tue, 5 Apr 2005 13:12:59 -0700 From: "David S. Miller" To: Christoph Lameter Cc: netdev@oss.sgi.com Subject: Re: atomic_dec_and_test for child dst needed in dst_destroy? Message-Id: <20050405131259.4b00b8de.davem@davemloft.net> In-Reply-To: References: <20050405123438.28f02423.davem@davemloft.net> <20050405125014.1ce46c66.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.83/808/Tue Apr 5 02:54:46 2005 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 1450 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 5 Apr 2005 12:58:15 -0700 (PDT) Christoph Lameter wrote: > On Tue, 5 Apr 2005, David S. Miller wrote: > > > > I fail to see what the point of having a single instance of > > > atomic_dec_and_test for __refcnt is. In particular since the upper layers > > > guarantee that dst_destroy is not called multiple times for the same dst > > > entry. > > > > If this is true, what performance improvement could you possibly be > > seeing from this change? > > We could make refcnt into an array of pointers that point to node specific > memory. This avoids cache line bouncing. However, you cannot atomically > dec_and_test an array. This is the only location where a dec_and_test is > used on dst->__refcnt. The dst object is already too large. You have to show a serious performance improvement to justify bloating it up further. > We can put an explicit barier in if that is the only reason for the > atomic_dec_and_test. Then we lose the optimizations of those memory barriers that platforms do in their atomic_op assembly. Let me check out if your assertions about dst_destroy() usage are correct first, hold on for a bit.