Re: Debugging Thinkpad T430s occasional suspend failure.

From: Frederic Weisbecker
Date: Tue Feb 19 2013 - 05:38:50 EST


2013/2/18 Thomas Gleixner <tglx@xxxxxxxxxxxxx>:
> On Mon, 18 Feb 2013, Frederic Weisbecker wrote:
>> diff --git a/kernel/softirq.c b/kernel/softirq.c
>> index ed567ba..69fbefd 100644
>> --- a/kernel/softirq.c
>> +++ b/kernel/softirq.c
>> @@ -277,6 +277,17 @@ restart:
>> tsk_restore_flags(current, old_flags, PF_MEMALLOC);
>> }
>>
>> +#ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED
>
> We really should get rid of that and make irqs disabled on irq exit
> mandatory.

Until now I even thought that having irqs disabled in irq_exit() was
mandatory. I need to have a second look at tick_nohz_irq_exit() as I
modified it with this requirement in mind...

Also with this patch, if a nesting interrupt happens right after
tick_nohz_irq_exit(), this new irq will call tick_nohz_stop_idle() but
not tick_nohz_start_idle() on the end. Leaving that unbalanced. I
could work that around but I don't want to spaghettize further around
that ifdef.

So this patch actually does depend on __ARCH_IRQ_EXIT_IRQS_DISABLED. I
need to convert all archs to force this first. Then think about the
softirq.c cleanup once its done.

I wonder what's the right path to this, may be loop over archs until
they all have __ARCH_IRQ_EXIT_IRQS_DISABLED, then remove that? Sounds
like non-sense but the safest way at the same time.

>> @@ -320,20 +331,45 @@ void irq_enter(void)
>> __irq_enter();
>> }
>>
>> +/*
>> + * Invoce softirq's from irq_exit().
>> + *
>> + * Return the preempt offset: either IRQ_EXIT_OFFSET (if we
>> + * did nothing to the preemption count) or SOFTIRQ_OFFSET (in
>> + * case we did softirq processing and changed the preemption
>> + * count to account for that).
>> + */
>> static inline void invoke_softirq(void)
>> {
>> - if (!force_irqthreads) {
>> + /* Can we run softirq's at all? We migth be nesting interrupts */
>> + if (in_nesting_interrupt())
>> + return;
>
> We might also be in a softirq disabled region where it makes no sense
> to continue. So this should be
>
> in_nesting_interrupt() || in_softirq()

in_nesting_interrupt() takes care of that as well.
--
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/