lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 05 Jun 2013 21:29:54 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	greearb@...delatech.com
Cc:	linux-kernel@...r.kernel.org, tj@...nel.org
Subject: Re: [PATCH] Fix lockup related to stop_machine being stuck in
 __do_softirq.

On Wed, 2013-06-05 at 21:25 -0700, greearb@...delatech.com wrote:
> From: Ben Greear <greearb@...delatech.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 !


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ