Re: preempt_check_resched() gone?

From: Ville Syrjälä
Date: Fri Mar 07 2014 - 07:14:40 EST


On Thu, Mar 06, 2014 at 09:52:42PM +0100, Thomas Gleixner wrote:
> On Thu, 6 Mar 2014, Ville Syrjälä wrote:
> > Hi,
> >
> > It appears preempt_check_resched() is no longer available for modules
> > since [1]. So now I'm left wondering what is one supposed to use after
> > local_irq_enable(). Documentation/preempt-locking.txt still says one
> > should do a check, but the tool to do that was taken away.
>
> The documentation is slightly misleading. The point is:
>
> If you have an irq disabled section and you do a wakeup inside this
> section which causes the need resched bit to be set, then
> local_irq_enable/restore wont do an preemption check.
>
> If you merily poke at a few device registers then nothing will set
> need resched and you're good.

OK. There are a few extra things that get called while irqs are
disabled: prepare_to_wait(), finish_wait(), mod_timer(),
spin_{lock,unlock}(). Based on a quick glance none of those should
do anything I need to worry about, so I'll just drop
preempt_check_resched() from my code.

Thanks.

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