[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200908182121.24726.arnd@arndb.de>
Date: Tue, 18 Aug 2009 21:21:24 +0000
From: Arnd Bergmann <arnd@...db.de>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Michael Spang <mspang@...lub.uwaterloo.ca>,
"David S. Miller" <davem@...emloft.net>,
LKML <linux-kernel@...r.kernel.org>,
Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH] Revert netlink ABI change to gnet_stats_basic
On Sunday 16 August 2009 19:36:49 Eric Dumazet wrote:
> In 5e140dfc1fe87eae27846f193086724806b33c7d "net: reorder struct Qdisc
> for better SMP performance" the definition of struct gnet_stats_basic
> changed incompatibly, as copies of this struct are shipped to
> userland via netlink.
>
> Restoring old behavior is not welcome, for performance reason.
>
> Fix is to use a private structure for kernel, and
> teach gnet_stats_copy_basic() to convert from kernel to user land,
> using legacy structure (struct gnet_stats_basic)
Are you sure that the packed structure is actually an advantage
for performance? On architectures that do not have unaligned stores
in hardware, the compiler will generate highly inefficient code
for accessing packed variables, in order to avoid alignment exceptions.
It would need some more measurements, but I'd guess that
struct gnet_stats_basic_packed
{
__u64 bytes __attribute__ ((packed, aligned(4)));
__u32 packets;
};
would give significantly better code on those architectures than
your version, while still giving you the 12-byte size.
Arnd <><
--
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