[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABi1daFSV6ByHQ59zwbPjEeg5Mood9XUw=N4LeSD+bFGU4+_4Q@mail.gmail.com>
Date: Mon, 7 Nov 2011 09:08:03 -0800
From: Dave Hylands <dhylands@...il.com>
To: loody <miloody@...il.com>
Cc: Jonathan Corbet <corbet@....net>,
LKML <linux-kernel@...r.kernel.org>,
kernelnewbies@...nelnewbies.org
Subject: Re: some questions about block and scatterlist
Hi loody,
On Mon, Nov 7, 2011 at 5:16 AM, loody <miloody@...il.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists