RE: 2.6.9 PageAnon bug

From: Hugh Dickins
Date: Wed Oct 20 2004 - 13:42:39 EST


On Wed, 20 Oct 2004, Mikael Starvik wrote:

> >Ah, sorry for messing CRIS up, I was unaware of that.
>
> Well, it's kind of odd nowadays to have the freedom of arbitrary alignment.
>
> >I don't think that's ugly, and the comment is good.
> >It only actually needs "aligned(2)", would that be better?
>
> Yes, aligned(2) is enough.
>
> >But what does "aligned(2)" or "aligned(4)" do on 64-bit machines -
> >any danger of it aligning stupidly? I think not, but know little.
>
> Same here, we need input from the 64-bit world (or make it aligned(8)).
>
> >>Another possible patch would be to move i_data above i_bytes and i_sock.
> >Really? Precarious, I think you'd still need to insist on alignment.
>
> I agree that there may be compilers out there that actually pads the
> structure to make the members unaligned. So you are correct, aligned()
> should be used to be safe (until memory allocation routines start to return
> unaligned addresses).
>
> Will you send this upstream to Andrew?

Not without confirmation from people who know more about
__attribute__((aligned(N))) than we do. I notice init.h has an
__attribute__((aligned((sizeof(long)))))
which perhaps would be better (though going the other way than from 4 to 2).

And would it be better on the declaration of struct address_space itself,
than on the struct address_space i_data?

If nobody chimes in to help us, I'll ping a few people in a day or two:
for now use what works for you.

Hugh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/