[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20081124.210038.90767194.davem@davemloft.net>
Date: Mon, 24 Nov 2008 21:00:38 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: dada1@...mosbay.com
Cc: andi@...stfloor.org, netdev@...r.kernel.org
Subject: Re: [RFC] Could we avoid touching dst->refcount in some cases ?
From: Eric Dumazet <dada1@...mosbay.com>
Date: Tue, 25 Nov 2008 05:43:32 +0100
> Very interesting. So we could try the following path :
>
> 1) First try to release dst when queueing skb to various queues
> (UDP, TCP, ...) while its hot. Reader wont have to release it
> while its cold.
>
> 2) Check if we can handle the input path without any refcount
> dirtying ?
>
> To make the transition easy, we could use a bit on skb to mark
> dst being not refcounted (ie no dst_release() should be done on it)
It is possible to make this self-auditing. For example, by
using the usual trick where we encode a pointer in an
unsigned long and use the low bits for states.
In the first step, make each skb->dst access go through some
accessor inline function.
Next, audit the paths where skb->dst's can "escape" the pure
packet input path. Add annotations, in the form of a
inline function call, for these locations.
Also, audit the other locations where we enqueue into a socket
queue and no longer care about the skb->dst, and annotate
those with another inline function.
Finally, the initial skb->dst assignment in the input path doesn't
grab a reference, but sets the low bit ("refcount pending") in
the encoded skb->dst pointer. The skb->dst "escape" inline
function performs the deferred refcount grab. And kfree_skb()
is taught to not dst_release() on skb->dst's which have the
low bit set.
Anyways, something like that.
--
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