[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20111108.143630.106539981030509701.davem@davemloft.net>
Date: Tue, 08 Nov 2011 14:36:30 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: steffen.klassert@...unet.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 2/4] ipv4: Update pmtu informations on inetpeer only
for output routes
From: David Miller <davem@...emloft.net>
Date: Wed, 12 Oct 2011 17:08:05 -0400 (EDT)
> From: Steffen Klassert <steffen.klassert@...unet.com>
> Date: Tue, 11 Oct 2011 13:10:27 +0200
>
>> @@ -1817,9 +1819,14 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4,
>> if (inet_metrics_new(peer))
>> memcpy(peer->metrics, fi->fib_metrics,
>> sizeof(u32) * RTAX_MAX);
>> - dst_init_metrics(&rt->dst, peer->metrics, false);
>>
>> - check_peer_pmtu(&rt->dst, peer);
>> + dst_init_metrics(dst, peer->metrics, false);
>> + check_peer_pmtu(dst, peer);
>> +
>> + if (rt_is_input_route(rt))
>> + dst_metric_set(dst, RTAX_MTU,
>> + dst->ops->default_mtu(dst));
>> +
>
> You really can't do this, it's going to kill all of the memory savings from
> storing metrics in the inetpeer cache.
>
> Every input route is going to have it's metrics COW'd with this change.
>
> The whole idea is to use defaults as heavily as possible, and that's
> the entire reason why the dst->ops->default_mtu() method exists, so
> that we can just leave the values alone and have read-only copies %99
> of the time.
>
> Please rearrange your fix so that these goals are still achieved.
What I think you can do to solve this problem is explicitly use
dst->ops->default_mtu() in ip_forward() instead of dst_mtu().
That way you won't use the cached PMTU for input routes.
--
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