Thread (16 messages) 16 messages, 4 authors, 2005-02-09

Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE

From: "David S. Miller" <davem@davemloft.net>
Date: 2005-02-07 06:25:22

On Sat, 29 Jan 2005 00:03:27 +0100
Thomas Graf [off-list ref] wrote:
NLMSG_GOODSIZE specifies a good default size for the skb tailroom
used in netlink messages when the size is unknown at the time of
the allocation.

The current value doesn't make much sense anymore because
skb_shared_info isn't taken into account which means that
depending on the architecture NLMSG_GOOSIZE can exceed PAGE_SIZE
resulting in a waste of almost a complete page.

Using SKB_MAXORDER solves this potential leak at the cost of
slightly smaller but safer sizes for some architectures.
Applied, to 2.4.x and 2.6.x, thanks Thomas.

This issue comes up again and again.  In the most recent
discussion I remember partaking in, I was trying to get it
so that all the code paths would calculate the size they
actually needed.  Most, if not all, are able to do so.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help