[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.01.1003250014400.16715@obet.zrqbmnf.qr>
Date: Thu, 25 Mar 2010 00:17:01 +0100 (CET)
From: Jan Engelhardt <jengelh@...ozas.de>
To: Andreas Schwab <schwab@...ux-m68k.org>
cc: David Miller <davem@...emloft.net>, tony.luck@...el.com,
netdev@...r.kernel.org
Subject: Re: Seeing new kernel unaligned access messages in linux-next on
ia64
On Wednesday 2010-03-24 23:47, Andreas Schwab wrote:
>Jan Engelhardt writes:
>
>> Using a temporary and memcpying it off would normally fix this,
>> as in the patch below. During testing however, I still get
>> unaligned messages even with the patch - and I would not know
>> what causes this.
>
>The memcpy will not fix the alignment issue because the copy operation
>is fully equivalent to a direct assignment, and the compiler can still
>take advantage of the known alignment of the types. You have to
>explicitly tell the compiler about the reduced alignment guarantee.
You're right, I remember seeing that sort of optimization before. So I
have changed the function's signature to read
-static void copy_rtnl_link_stats64(struct rtnl_link_stats64 *v,
- const struct net_device_stats *b)
+static void copy_rtnl_link_stats64(void *v, const struct net_device_stats *b)
{
...
memcpy(v, &a, sizeof(a));
}
No more unaligned messages - but is this an acceptable solution?
thanks,
Jan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists