From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH] scsi: align shost->hostdata to cacheline Date: Thu, 21 Feb 2008 11:32:50 +0900 Message-ID: <47BCE2D2.5030506@gmail.com> References: <20080212180254.GA28237@postdiluvian.org> <20080212221257.12eeab13@core> <20080213184702.GA13458@postdiluvian.org> <20080213202151.34b7e5bc@core> <20080213212549.GA14732@postdiluvian.org> <20080214002135.065dd322@core> <47B3AFDC.5040605@gmail.com> <47B40E51.3060002@gmail.com> <1203001520.3189.11.camel@localhost.localdomain> <47B4C55F.1070806@gmail.com> <1203101837.3058.34.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from rv-out-0910.google.com ([209.85.198.188]:50590 "EHLO rv-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbYBUCc4 (ORCPT ); Wed, 20 Feb 2008 21:32:56 -0500 Received: by rv-out-0910.google.com with SMTP id k20so2095736rvb.1 for ; Wed, 20 Feb 2008 18:32:56 -0800 (PST) In-Reply-To: <1203101837.3058.34.camel@localhost.localdomain> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: James Bottomley Cc: Alan Cox , Mark Mason , linux-ide@vger.kernel.org, jgarzik@pobox.com, Jens Axboe James Bottomley wrote: > On Fri, 2008-02-15 at 07:49 +0900, Tejun Heo wrote: >> James Bottomley wrote: >>> On Thu, 2008-02-14 at 18:48 +0900, Tejun Heo wrote: >>>> shost->hostdata can contain arbitrary data including DMA target >>>> buffers. Align it to cacheline. >>>> >>>> Signed-off-by: Tejun Heo >>>> --- >>>> James, what do you think? >>> Hmm, it will blow out the host size ... although that's not such a huge >>> problem since there are relatively few of them in most running kernels. >>> What's the actual use case for this, though? The host structure is >>> allocated in ordinary memory ... we don't make sure it's DMAable, and >>> most HBAs that want to use memory for mailboxes need coherent memory >>> anyway. >> "As it can contain arbitrary structure, it should follow the largest >> meaningful alignment to allow the contained structure proper alignment." >> is the logic. I think it's generally RTTD for inline private data but >> feel free to disagree. > > Well, the way we usually do that is to have the host float the alignment > if necessary. The problem with relying on __cacheline_aligned for an > allocated structure is that it only works if the allocated structure > actually begins on a cacheline. Kmalloc (which is where we get the host > from) doesn't necessarily obey this if certain slab debugging flags are > present. Hmmm... Right. That means libata either needs to create a separate slab for the sector buf or align it after allocating by itself. Eeeek. Thanks. -- tejun