netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mkubecek@suse.cz
Cc: netdev@vger.kernel.org, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
	yoshfuji@linux-ipv6.org, kaber@trash.net
Subject: Re: [PATCH net] ipv6: prevent fib6_run_gc() contention
Date: Mon, 10 Jun 2013 14:26:42 -0700 (PDT)	[thread overview]
Message-ID: <20130610.142642.161876882927700341.davem@davemloft.net> (raw)
In-Reply-To: <20130604111040.CCC9162CB4@unicorn.suse.cz>

From: Michal Kubecek <mkubecek@suse.cz>
Date: Tue, 4 Jun 2013 13:08:59 +0200

> On a high-traffic router with many processors and many IPv6 dst
> entries, soft lockup in fib6_run_gc() can occur when number of
> entries reaches gc_thresh.
> 
> This happens because fib6_run_gc() uses fib6_gc_lock to allow
> only one thread to run the garbage collector but ip6_dst_gc()
> doesn't update net->ipv6.ip6_rt_last_gc until fib6_run_gc()
> returns. On a system with many entries, this can take some time
> so that in the meantime, other threads pass the tests in
> ip6_dst_gc() (ip6_rt_last_gc is still not updated) and wait for
> the lock. They then have to run the garbage collector one after
> another which blocks them for quite long.
> 
> Resolve this by replacing special value ~0UL of expire parameter
> to fib6_run_gc() by explicit "force" parameter to choose between
> spin_lock_bh() and spin_trylock_bh() and call fib6_run_gc() with
> force=false if gc_thresh is reached but not max_size.
> 
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

It seems to me that it would be much simpler to simply update
ip6_rt_last_gc first, that way the other threads would elide the GC
call.

Can you see if simply doing that fixes the problem too?

Thanks.

  reply	other threads:[~2013-06-10 21:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 11:08 [PATCH net] ipv6: prevent fib6_run_gc() contention Michal Kubecek
2013-06-10 21:26 ` David Miller [this message]
2013-06-11 10:07   ` Michal Kubecek
2013-06-11 10:40     ` Eric Dumazet
2013-06-11 20:01     ` David Miller
2013-06-11 20:49       ` Michal Kubecek
2013-06-11 21:22         ` David Miller
2013-07-31 22:19           ` Michal Kubecek
2013-07-31 23:43             ` 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=20130610.142642.161876882927700341.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).