All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: <netdev@vger.kernel.org>
Subject: perf regression from ipv6: use net->rt_genid to check dst validity
Date: Mon, 16 Jun 2014 17:31:15 -0400	[thread overview]
Message-ID: <539F6223.4040006@fb.com> (raw)

Hi everyone,

I tracked down a perf regression last week in our 3.10-stable based
kernel.  fib6_lookup_1 was at the top of the profiles, being called very
frequently during sends.  The 2.6.38 kernel we were comparing
against only called fib6_lookup_1 during recv.

The call chain was doing the lookups because we were always tossing the
destination cache.  A little trial and error led me to this commit:

	commit 6f3118b571b8a4c06c7985dc3172c3526cb86253
	Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>
	Date:   Mon Sep 10 22:09:46 2012 +0000

	    ipv6: use net->rt_genid to check dst validity

The workload was our in memory database, and dropping this commit gave
us a 10% boost to overall queries per second.

Moving up to mainline, it looks like we're still failing the validity
check most of the time.  A few printks show when we do fail, it's always
this line:

       if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev)))

The cached dst had a genid of 2 and the dev_net version was 3.

What I haven't done yet is fully reproduce the 10% hit on mainline.  I
have a few patches to port in and I'll get a workload running on 3.15.
But it doesn't look like this part has changed.  Somehow we're hanging
onto a destination cache with an old genid and we're hammering on lookups
because of it.

Any ideas before I shower things with printk?

-chris

                 reply	other threads:[~2014-06-16 21:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=539F6223.4040006@fb.com \
    --to=clm@fb.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.