lkml.org 
[lkml]   [2011]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: some questions about block and scatterlist
From
Hi loody,

On Mon, Nov 7, 2011 at 5:16 AM, loody <miloody@gmail.com> wrote:
...snip...
>>> 1. Are all struct page 32-bit aligned?
>>
>> Certainly, I would expect any structures found in the system memory map to
>> be so aligned, yes.  If you've created an arbitrary one elsewhere I'm only
>> 99% sure it would be.
>>
>>> If so, where is this part of code for handleing struct page be 32-bits aligned?
>>
>> Note that the size of struct page is carefully considered, and that they
>> are packed as densely as possible, both externally and internally.  No
>> lesser alignment would make sense.
> I found kernel stealing LSB of page_link to put additional
> information, such as sg_is_chain and sg_is_last.
>
> That means the address of all pages have to be at least 4byte alignment.
> But I didn't see any additional attribute added at the end of struct
> or any precaution to take care this.

This is done automatically by the compiler.
http://en.wikipedia.org/wiki/Data_structure_alignment

--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
--
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/

\
 
 \ /
  Last update: 2011-11-07 18:11    [W:0.042 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site