From: Daniel J Blueman <daniel.blueman@gmail.com>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, H Peter Anvin <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ioapic: fix potential resume deadlock
Date: Thu, 12 May 2011 00:15:04 +0800 [thread overview]
Message-ID: <BANLkTimvX3YXTxVSHDFm1N9a8vsALufrMg@mail.gmail.com> (raw)
In-Reply-To: <1305071894.2736.50.camel@sbsiddha-MOBL3.sc.intel.com>
On 11 May 2011 07:58, Suresh Siddha <suresh.b.siddha@intel.com> wrote:
> On Tue, 2011-05-10 at 03:53 -0700, Daniel J Blueman wrote:
>> On 10 May 2011 15:35, Ingo Molnar <mingo@elte.hu> wrote:
>> > Hm, there must be some other bug here.
>> >
>> > ioapic entries should be allocated on system bootup and should never really be
>> > deallocated.
>> >
>> > The bug might be in the idea to call to enable_IR_x2apic() on resume - why are
>> > ioapic entries reallocated there? That call in default_setup_apic_routing() was
>> > introduced some time ago in:
>> >
>> > fa47f7e52874: x86, x2apic: Simplify apic init in SMP and UP builds
>> >
>> > and that it results in reallocation in the suspend patch is distinctly wrong.
>> >
>> > I suspect the reason why this has not triggered for others is the relative
>> > rarity of affected systems?
>> >
>> > Suresh?
>
> This will happen only on interrupt-remapping enabled systems and hence
> hidden so far.
>
> enable_IR_x2apic() / default_setup_apic_routing() routines don't get
> called during resume. Problem is with the lapic_resume() path which is
> trying to re-enable x2apic mode and this requires masking io-apic
> entries, re-enabling x2apic and interrupt-remapping, restoring io-apic
> entries etc. ioapic entry allocation that is happening in lapic_resume()
> is just for storing the original io-apic RTE's during the mask/restore
> operations that happen around re-enabling x2apic.
>
> Anyways looking at that code, there is some duplicate code between
> x2apic code and the io-apic suspend/resume sequence. So a better fix
> will be to remove this duplicate code.
>
> Daniel, I appended a quick patch which should fix the problem you
> reported. This is not a final patch, as I can do some more cleanup and
> re-use the io-apic suspend/resume code a bit more.
>
> If this patch works for you, then I can spend some more time to do the
> complete cleanup patch in a day or two. Thanks.
[...]
Superb, this works, tested against 2.6.39-rc7 and addresses the "BUG:
sleeping function called from invalid context at mm/slub.c:824"
warning I was previously seeing. It would be good to get this fix into
2.6.39-final if possible.
Tested-by: Daniel J Blueman <daniel.blueman@gmail.com>
Thanks,
Daniel
--
Daniel J Blueman
next prev parent reply other threads:[~2011-05-11 16:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 2:40 Daniel J Blueman
2011-05-10 5:32 ` Daniel J Blueman
2011-05-10 7:35 ` Ingo Molnar
2011-05-10 10:53 ` Daniel J Blueman
2011-05-10 23:58 ` Suresh Siddha
2011-05-11 16:15 ` Daniel J Blueman [this message]
2011-05-13 17:48 ` Suresh Siddha
2011-05-14 14:39 ` Daniel J Blueman
2011-05-16 11:32 ` Ingo Molnar
2011-05-16 17:04 ` Suresh Siddha
2011-05-16 11:34 ` Ingo Molnar
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=BANLkTimvX3YXTxVSHDFm1N9a8vsALufrMg@mail.gmail.com \
--to=daniel.blueman@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome