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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 8 Jun 2012 22:41:54 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Francois Romieu <romieu@...zoreil.com>
cc:	Dave Jones <davej@...hat.com>,
	Marc Dionne <marc.c.dionne@...il.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: NOHZ: local_softirq_pending 08

On Fri, 8 Jun 2012, Francois Romieu wrote:

> Thomas Gleixner <tglx@...utronix.de> :
> [...]
> > I can't find the point where the warning is issued, but I think I
> > found the cause of the problem.
> > 
> > static void rtl_slow_event_work(struct rtl8169_private *tp)
> > {
> > 	.....
> > 	napi_schedule(&tp->napi);
> > 	  --> __napi_schedule();
> > 	      -->	list_add_tail(&napi->poll_list, &sd->poll_list);
> > 	              __raise_softirq_irqoff(NET_RX_SOFTIRQ);
> > 
> > 		      This merily sets the softirq bit.
> > 
> > 
> > So this code is really wrong. It's called from full preemptible
> > context of the workqueue. And if the next thing is a context switch to
> > idle then the pending softirq check will trigger.
> 
> void __napi_schedule(struct napi_struct *n)
> {
>         unsigned long flags;
> 
>         local_irq_save(flags);
>         ____napi_schedule(&__get_cpu_var(softnet_data), n);
>         local_irq_restore(flags);
> }
> 
> Are you saying that this stuff should be considered "preemptible" ?

Gah, crap. Looked at the wrong ___________underscore level. I _____so
__love _that.

Though the problem is, that it is neither called in interrupt context
nor with bh disabled, so nothing invokes the softirq before it reaches
idle.

In hard interrupt context the pending flag is evaluated in irq_exit()
and the softirqs are invoked from there. If you call that from thread
context, then a bh_disable/enable pair will make sure that the pending
softirq is invoked. Did I miss some more ___underscore magic which
does that ?

Thanks,

	tglx


--
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