netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Paweł Staszewski" <pstaszewski@itcare.pl>,
	"David Miller" <davem@davemloft.net>,
	"Linux Network Development list" <netdev@vger.kernel.org>
Subject: Re: [PATCH] dst: call cond_resched() in dst_gc_task()
Date: Mon, 8 Feb 2010 15:26:06 -0800	[thread overview]
Message-ID: <20100208152606.91c55722.akpm@linux-foundation.org> (raw)
In-Reply-To: <1265657560.4236.80.camel@edumazet-laptop>

On Mon, 08 Feb 2010 20:32:40 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> [PATCH] dst: call cond_resched() in dst_gc_task()
> 
> On some workloads, it is quite possible to get a huge dst list to
> process in dst_gc_task(), and trigger soft lockup detection.
> 
> Fix is to call cond_resched(), as we run in process context.
> 
> Reported-by: Pawel Staszewski <pstaszewski@itcare.pl>
> Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> 
> diff --git a/net/core/dst.c b/net/core/dst.c
> index 57bc4d5..cb1b348 100644
> --- a/net/core/dst.c
> +++ b/net/core/dst.c
> @@ -17,6 +17,7 @@
>  #include <linux/string.h>
>  #include <linux/types.h>
>  #include <net/net_namespace.h>
> +#include <linux/sched.h>
>  
>  #include <net/dst.h>
>  
> @@ -79,6 +80,7 @@ loop:
>  	while ((dst = next) != NULL) {
>  		next = dst->next;
>  		prefetch(&next->next);
> +		cond_resched();
>  		if (likely(atomic_read(&dst->__refcnt))) {
>  			last->next = dst;
>  			last = dst;

Gad.  Am I understanding this right?  The softlockup threshold is sixty
seconds!

I assume that this function spends most of its time walking over busy
entries?  Is a more powerful data structure needed?


  parent reply	other threads:[~2010-02-08 23:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 13:16 Problem wit route cache Paweł Staszewski
2010-02-08 13:28 ` Eric Dumazet
2010-02-08 13:33   ` Paweł Staszewski
2010-02-08 13:51     ` Eric Dumazet
2010-02-08 13:59       ` Paweł Staszewski
2010-02-08 14:06         ` Eric Dumazet
2010-02-08 14:16           ` Paweł Staszewski
2010-02-08 14:32             ` Eric Dumazet
2010-02-08 19:32               ` [PATCH] dst: call cond_resched() in dst_gc_task() Eric Dumazet
2010-02-08 23:01                 ` David Miller
2010-02-09  6:07                   ` Eric Dumazet
2010-02-08 23:26                 ` Andrew Morton [this message]
2010-02-08 23:34                   ` David Miller
2010-02-08 23:37                     ` Andrew Morton
2010-02-08 23:50                       ` David Miller
2010-02-08 23:50                       ` Stephen Hemminger
2010-02-09  6:06                         ` Eric Dumazet
2010-02-09  6:35                           ` Andrew Morton
2010-02-09  7:20                             ` Eric Dumazet
2010-02-09  7:31                               ` Andrew Morton
2010-02-08 14:32             ` Problem wit route cache Paweł Staszewski
2010-02-08 14:45               ` Paweł Staszewski

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=20100208152606.91c55722.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pstaszewski@itcare.pl \
    /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).