Re: [PATCH] scsi: align shost->hostdata to cacheline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <htejun@xxxxxxxxx>
>>>> ---
>>>> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux