Linux ATA/IDE development
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Mark Mason <mason@postdiluvian.org>,
	linux-ide@vger.kernel.org, jgarzik@pobox.com,
	Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] scsi: align shost->hostdata to cacheline
Date: Fri, 15 Feb 2008 12:57:17 -0600	[thread overview]
Message-ID: <1203101837.3058.34.camel@localhost.localdomain> (raw)
In-Reply-To: <47B4C55F.1070806@gmail.com>


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 <htejun@gmail.com>
> >> ---
> >> 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.

James



  reply	other threads:[~2008-02-15 18:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 18:02 libata/sata_sil24 cache alignment problem? Mark Mason
2008-02-12 22:12 ` Alan Cox
2008-02-12 23:36   ` James Bottomley
2008-02-13  2:13     ` Alan Cox
2008-02-13  2:32       ` James Bottomley
2008-02-13 18:47   ` Mark Mason
2008-02-13 20:21     ` Alan Cox
2008-02-13 21:25       ` Mark Mason
2008-02-14  0:21         ` Alan Cox
2008-02-14  3:05           ` Tejun Heo
2008-02-14  9:44             ` [PATCH] libata: align ap->sector_buf to cacheline Tejun Heo
2008-02-14  9:48             ` [PATCH] scsi: align shost->hostdata " Tejun Heo
2008-02-14 15:05               ` James Bottomley
2008-02-14 22:49                 ` Tejun Heo
2008-02-15 18:57                   ` James Bottomley [this message]
2008-02-21  2:32                     ` Tejun Heo
2008-02-13 18:51   ` libata/sata_sil24 cache alignment problem? Mark Mason
2008-02-12 23:25 ` Thomas Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1203101837.3058.34.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=htejun@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=mason@postdiluvian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox