[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101216.132122.70179958.davem@davemloft.net>
Date: Thu, 16 Dec 2010 13:21:22 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [RFC PATCH] net: Implement read-only protection and COW'ing of
metrics.
From: David Miller <davem@...emloft.net>
Date: Thu, 16 Dec 2010 11:59:00 -0800 (PST)
> Hmm... perhaps we need to force-COW or revert to the default zero
> metrics for any routing cache entries with reference counts?
>
> Or maybe that's not even needed.
>
> Because nobody should try to touch metrics without first doing a
> dst->check(), especially after the RCU grace period, so it should be
> OK no?
Ok I did some audits and there are some problems in this area.
First of all I have to at least defer the kmalloc()'d metrics free
until the RCU callback.
Second of all things like tcp_update_metrics() use __sk_dst_get()
instead of __sk_dst_check().
I have an idea to use another pointer state bit to indicate that the
metrics are "dead". This would block all COW operations and writes.
Metric reads for obsolete dst's would be redirected to the read-only
all-zeros default array.
In this way we won't need to do anything different in places like
tcp_update_metrics().
I'll post a new patch once I sort all of this out.
Thanks for catching this!
--
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