mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: greearb@candelatech.com
Cc: linux-kernel@vger.kernel.org, tj@kernel.org
Subject: Re: [PATCH] Fix lockup related to stop_machine being stuck in __do_softirq.
Date: Wed, 05 Jun 2013 21:29:54 -0700	[thread overview]
Message-ID: <1370492994.24311.331.camel@edumazet-glaptop> (raw)
In-Reply-To: <1370492751-6886-1-git-send-email-greearb@candelatech.com>

On Wed, 2013-06-05 at 21:25 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>

> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index 14d7758..f150ad6 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -204,6 +204,7 @@ EXPORT_SYMBOL(local_bh_enable_ip);
>   * should not be able to lock up the box.

Could you update the comment ?

I had the following :

- * We restart softirq processing for at most 2 ms,
- * and if need_resched() is not set.
+ * We restart softirq processing for at most MAX_SOFTIRQ_RESTART times,
+ * but break the loop if need_resched() is set or after 2 ms.


>   */
>  #define MAX_SOFTIRQ_TIME  msecs_to_jiffies(2)
> +#define MAX_SOFTIRQ_RESTART 10
>  
>  asmlinkage void __do_softirq(void)
>  {
> @@ -212,6 +213,7 @@ asmlinkage void __do_softirq(void)
>  	unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
>  	int cpu;
>  	unsigned long old_flags = current->flags;
> +	int max_restart = MAX_SOFTIRQ_RESTART;
>  
>  	/*
>  	 * Mask out PF_MEMALLOC s current task context is borrowed for the
> @@ -265,7 +267,8 @@ restart:
>  
>  	pending = local_softirq_pending();
>  	if (pending) {
> -		if (time_before(jiffies, end) && !need_resched())
> +		if (time_before(jiffies, end) && !need_resched()
> +		    && --max_restart)
>  			goto restart;
>  
>  		wakeup_softirqd();


if (cond1 && cond2 &&
    cond3) ...

or

if (cond1 &&
    cond2 &&
    cond3) ...

Thanks !



  reply	other threads:[~2013-06-06  4:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06  4:25 greearb
2013-06-06  4:29 ` Eric Dumazet [this message]
2013-06-06 20:44   ` Tejun Heo

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=1370492994.24311.331.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=greearb@candelatech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®