From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932985AbXHNSSh (ORCPT ); Tue, 14 Aug 2007 14:18:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753361AbXHNSSH (ORCPT ); Tue, 14 Aug 2007 14:18:07 -0400 Received: from gw.goop.org ([64.81.55.164]:40302 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753354AbXHNSSF (ORCPT ); Tue, 14 Aug 2007 14:18:05 -0400 Message-ID: <46C1F168.5050102@goop.org> Date: Tue, 14 Aug 2007 11:16:08 -0700 From: Jeremy Fitzhardinge User-Agent: Thunderbird 2.0.0.5 (X11/20070719) MIME-Version: 1.0 To: Jesper Juhl CC: Jeff Garzik , NetDev , Keir Fraser , Linux Kernel Mailing List Subject: Re: [PATCH] xen-netfront: Avoid deref'ing skbafter it is potentially freed. References: <46C0B6FD.7020701@goop.org> <200708140203.30711.jesper.juhl@gmail.com> In-Reply-To: <200708140203.30711.jesper.juhl@gmail.com> X-Enigmail-Version: 0.95.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Jesper Juhl wrote: > This moves the updating of both tx_bytes and tx_packets inside the > spinlock, but as far as I can see we only _really_ need to move the > tx_bytes update. Considering that we generally want to do as little > work as possible while holding a lock, wouldn't the following be > slightly better? > Hm, I think it would be better to keep them together. The second add is going to be pretty much free, particularly since the tx_bytes add will probably pull tx_packets into cache. I have a followup patch to convert it to using the netdevice stats structure, which will definitely put them in the same cacheline (though perhaps the stats structure should group tx and rx members together?). J J