All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Dave Jones <davej@redhat.com>, Hugh Dickins <hughd@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Paul McKenney <paul.mckenney@linaro.org>
Subject: Re: Debugging Thinkpad T430s occasional suspend failure.
Date: Sun, 17 Feb 2013 16:11:24 +0100	[thread overview]
Message-ID: <CAFTL4hyTfwAZWz=gMokk5oG3HO8iGh7=FtoNv89CMg_Lm-TPNg@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFy8FeGMOnWwkfmyFYyVCw+k1LSVg7BG0tsTNZzqi5EKYg@mail.gmail.com>

2013/2/15 Linus Torvalds <torvalds@linux-foundation.org>:
> On Fri, Feb 15, 2013 at 9:44 AM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
>>
>> This commit was designed to increase the probability of hitting the
>> races described in http://lwn.net/Articles/453002/.  These races result
>> in deadlocks involving the runqueue lock (and perhaps also the priority
>> inheritance locks).  And yes, I most certainly should have described
>> this in the commit message.  :-(
>
> Ugh. That particular race seems to be because the softirq handling is
> just crazy, and does the "wakeup_softirqd()" form interrupt context,
> BUT HAS SPECIFICALLY BROKEN THE IRQ COUNTING!
>
> Because it claims to do it from softirq context, which is pure
> garbage. It's not actually in softirq context.
>
> The whole hardirq -> softirq transition seems stupid. I'm sure I made
> some serious mistake in cleaning it up, and there's probably some
> missed tracepoint (or perhaps screwed-up lockdep annotation), but I
> think the hardirq -> softirq preempt thing shoudl be done as an atomic
> preempt downgrade, so that we never have a window of "uhhuh, another
> interrupt can come in between and see us as being in neither). And the
> wakeup_softirqd should be done without playing with preempt count at
> all.
>
> Something like this ENTIRELY UNTESTED patch.
>
> Note: I doubt this patch affects Dave's issue at all, I just started
> looking at that do_softirq code when I read your bug explanation.
>
> Adding random people for kernel/softirq.c to the participants list.
> Comments about the patch? Do note that it's entirely untested, so
> consider it more a RFD than a real patch.. It looks like it adds a lot
> of lines, but most of it is for comments and simplification of the
> logic.

preempt_value_in_interrupt() looks buggy in your patch: it makes
invoke_softirq() returning if (val & HARDIRQ_MASK). But that's always
true since you have moved further the sub_preempt_count(IRQ_EXIT)
further.

  parent reply	other threads:[~2013-02-17 15:11 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 19:39 Debugging Thinkpad T430s occasional suspend failure Dave Jones
2013-02-12 20:13 ` Linus Torvalds
2013-02-13  0:26 ` Hugh Dickins
2013-02-13  0:40   ` Dave Jones
2013-02-13  0:56     ` Hugh Dickins
2013-02-13  4:16       ` Dave Jones
2013-02-13  5:37         ` Hugh Dickins
2013-02-13 19:34           ` Dave Jones
2013-02-13 19:56             ` Linus Torvalds
2013-02-13 20:53               ` Dave Jones
2013-02-16 20:54                 ` Paul E. McKenney
2013-02-15  1:15               ` Dave Jones
2013-02-15  2:09                 ` Linus Torvalds
2013-02-15 15:50                   ` Ingo Molnar
2013-02-15 22:33                     ` Dave Jones
2013-02-15 17:44                   ` Paul E. McKenney
2013-02-15 18:34                     ` Linus Torvalds
2013-02-15 18:35                       ` Linus Torvalds
2013-02-15 18:50                         ` Linus Torvalds
2013-02-16 19:25                           ` Paul E. McKenney
2013-02-16 19:46                             ` Linus Torvalds
2013-02-16 21:07                               ` Paul E. McKenney
2013-02-16 21:53                               ` H. Peter Anvin
2013-02-17 22:49                               ` H. Peter Anvin
2013-02-18  8:41                                 ` Ingo Molnar
2013-02-19  8:50                                   ` Paul E. McKenney
2013-02-19  8:56                                     ` Ingo Molnar
2013-02-17 15:11                       ` Frederic Weisbecker [this message]
2013-02-17 17:32                         ` Linus Torvalds
2013-02-17 18:17                           ` Frederic Weisbecker
2013-02-17 20:58                           ` Frederic Weisbecker
2013-02-17 21:02                             ` Frederic Weisbecker
2013-02-18 15:53                               ` Frederic Weisbecker
2013-02-18 18:12                                 ` Linus Torvalds
2013-02-19 10:08                                   ` Frederic Weisbecker
2013-02-18 19:58                                 ` Thomas Gleixner
2013-02-19 10:38                                   ` Frederic Weisbecker
2013-02-19 10:44                                     ` Thomas Gleixner
2013-02-15  2:09                 ` Hugh Dickins
2013-02-15  2:15                   ` Linus Torvalds
2013-02-16 21:45                     ` Hugh Dickins
2013-02-16 23:02                       ` Linus Torvalds
2013-02-17  0:01                         ` Hugh Dickins
2013-02-17  2:21                           ` Hugh Dickins
2013-02-17 13:38                             ` Daniel Vetter
2013-02-17 14:54                               ` Daniel Vetter
2013-02-17 16:31                               ` Hugh Dickins
2013-02-17 17:28                                 ` Daniel Vetter
2013-02-17 17:28                                   ` Daniel Vetter
2013-02-13  2:17   ` Dave Jones

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='CAFTL4hyTfwAZWz=gMokk5oG3HO8iGh7=FtoNv89CMg_Lm-TPNg@mail.gmail.com' \
    --to=fweisbec@gmail.com \
    --cc=davej@redhat.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paul.mckenney@linaro.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.