[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1388709534.12212.106.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 02 Jan 2014 16:38:54 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Tom Herbert <therbert@...gle.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] ipv4: move rt_genid to different cache line
On Thu, 2014-01-02 at 12:00 -0800, Tom Herbert wrote:
> Running a simple netperf TCP_RR test with 200 clients shows that
> ipv4_dst_check is high on the list of functions in 'perf top'. The
> pertinent action in this function is in the call to rt_is_expired
> which checks the route genid (rt->rt_gentid) against the global value.
> rt_genid is in the same cacheline as dst->__refcnt which is causing
> false sharing.
>
> This fix moves rt_genid into the first cacheline of the dst structure.
> The dst structue is explicitly packed for cacheline optimization, so to
> make room for the genid, I moved xfrm to cacheline with __refcnt (under
> the assumption it is less likely to be in the critical path).
This looks like a difficult to check assumption to me ....
rcu_head surely could be moved without performance impact.
Again, optimizing network stack for 200 TCP_RR special case is very
questionable. The dst must be refcounted because of special prequeue
mode, where a thread is blocked in a recvmsg() call.
Any modern application handling lot of sockets uses poll()/epoll()
anyway and prequeue is disabled : No refcount is taken, as the dst is
released (no refcount touch because of RCU) before the skb is queued
into socket receive queue.
--
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