Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754249AbYJARu3 (ORCPT ); Wed, 1 Oct 2008 13:50:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753705AbYJARuM (ORCPT ); Wed, 1 Oct 2008 13:50:12 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:47507 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752571AbYJARuL (ORCPT ); Wed, 1 Oct 2008 13:50:11 -0400 Date: Wed, 1 Oct 2008 13:49:59 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Mathieu Desnoyers cc: Linus Torvalds , Peter Zijlstra , Jonathan Corbet , LKML , Ingo Molnar , Thomas Gleixner , Andrew Morton , prasad@linux.vnet.ibm.com, "Frank Ch. Eigler" , David Wilder , hch@lst.de, Martin Bligh , Christoph Hellwig , Masami Hiramatsu , Steven Rostedt , Arnaldo Carvalho de Melo Subject: Re: [PATCH] ring_buffer: allocate buffer page pointer In-Reply-To: <20081001173653.GA14538@Krystal> Message-ID: References: <20080930000307.GA2929@Krystal> <20080930034603.GA13801@Krystal> <20080930092001.69849210@bike.lwn.net> <1222790072.24384.21.camel@twins> <20081001173653.GA14538@Krystal> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1410 Lines: 35 On Wed, 1 Oct 2008, Mathieu Desnoyers wrote: > > I understand that you want to allocate these struct buffer_page in > memory local to a given cpu node, which is great, but why do you feel > you need to align them on cache_line_size() ? > > Hrm.. you put the timestamp in there, so I guess you're concerned about > having a writer on one CPU, a reader on another, and the fact that you > will have cache line bouncing because of that. > > Note that if you put the timestamp and the unused bytes in a tiny header > at the beginning of the page, you > > 1 - make this information directly accessible for disk, network I/O > without any other abstraction layer. > 2 - won't have to do such alignment on the struct buffer_page, because > it will only be read once it's been allocated. > That was the approach I actually started with. But someone (I think Peter) asked me to remove it. Who knows, perhaps I can put it back. It's not that hard to do. This is why I used BUF_PAGE_SIZE to determine the size of the buffer page. Right now it BUF_PAGE_SIZE == PAGE_SIZE, but if we do add a header than it will be BUF_PAGE_SIZE == PAGE_SIZE - sizeof(header) -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/