netdev
[Top] [All Lists]

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

To: Thomas Graf <tgraf@xxxxxxx>
Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Sun, 6 Feb 2005 22:25:22 -0800
Cc: kuznet@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20050128230327.GV31837@xxxxxxxxxxxxxx>
References: <20050128230327.GV31837@xxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Sat, 29 Jan 2005 00:03:27 +0100
Thomas Graf <tgraf@xxxxxxx> 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.

<Prev in Thread] Current Thread [Next in Thread>