All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [RFC PATCH] net: Implement read-only protection and COW'ing of metrics.
Date: Thu, 16 Dec 2010 13:21:22 -0800 (PST)	[thread overview]
Message-ID: <20101216.132122.70179958.davem@davemloft.net> (raw)
In-Reply-To: <20101216.115900.183061857.davem@davemloft.net>

From: David Miller <davem@davemloft.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!


  reply	other threads:[~2010-12-16 21:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 21:21 [RFC PATCH] net: Implement read-only protection and COW'ing of metrics David Miller
2010-12-16 19:55 ` Eric Dumazet
2010-12-16 19:59   ` David Miller
2010-12-16 21:21     ` David Miller [this message]
2011-01-26 23:25     ` David Miller
2011-01-26 23:31       ` David Miller
2011-01-27 10:01       ` Eric Dumazet
2011-01-27 10:20         ` Eric Dumazet
2011-01-27 20:29           ` David Miller
2011-01-27 20:28         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101216.132122.70179958.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.