From: Vivek Goyal <vgoyal@redhat.com>
To: Takao Indoh <indou.takao@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
Milton Miller <miltonm@bga.com>, Jens Axboe <axboe@kernel.dk>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>, WANG Cong <xiyou.wangcong@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH v2] generic-ipi: Initialize call_single_queue before enabling interrupt
Date: Thu, 7 Apr 2011 09:40:46 -0400 [thread overview]
Message-ID: <20110407134046.GA27778@redhat.com> (raw)
In-Reply-To: <ECCBF4AD4D39CDindou.takao@jp.fujitsu.com>
On Wed, Apr 06, 2011 at 06:52:27PM -0400, Takao Indoh wrote:
> On Wed, 06 Apr 2011 18:47:36 -0400, Takao Indoh wrote:
>
> >On Wed, 6 Apr 2011 16:47:42 -0400, Vivek Goyal wrote:
> >
> >>On Tue, Mar 29, 2011 at 12:35:04PM -0400, Takao Indoh wrote:
> >>> Hi all,
> >>>
> >>> This patch renames init_call_single_data() to call_function_init() and
> >>> calls it in start_kernel() so that call_single_queue can be initialized
> >>> before enabling interrupt.
> >>>
> >>> There is a problem that kdump(2nd kernel) sometimes hangs up due to
> >>> pending IPI from 1st kernel. Kernel panic occurs because IPI comes
> >>> before call_single_queue is initialized. The details are as follows.
> >>> (1) 2nd kernel boot up
> >>> (2) A pending IPI from 1st kernel comes when irqs are first enabled
> >>> in start_kernel().
> >>> (3) Kernel tries to handle the interrupt, but call_single_queue is not
> >>> initialized yet at this point. As a result, in the
> >>> generic_smp_call_function_single_interrupt(), NULL pointer
> >>> dereference occurs when list_replace_init() tries to access
> >>> &q->list.next.
> >>> Therefore this patch changes the name of init_call_single_data() to
> >>> call_function_init() and calls it before local_irq_enable() in
> >>> start_kernel().
> >>>
> >>> v2:
> >>> - Rename init_call_single_data() to call_function_init() and calls it in
> >>> start_kernel()
> >>> - Change insert position in start_kernel().
> >>> - Adjust for CONFIG_SMP/CONFIG_USE_GENERIC_SMP_HELPERS options
> >>> - Rebased to Linus's latest tree
> >>>
> >>> v1:
> >>> https://lkml.org/lkml/2011/3/25/317
> >>> - Divide init_call_single_data() into two functions,
> >>> o init_call_single_data: initialize call_single_queue
> >>> o init_hotplug_cfd: initialize hotplug_cfd_notifier
> >>> And call init_call_single_data before local_irq_enable() in
> >>> start_kernel().
> >>>
> >>> v0:
> >>> https://lkml.org/lkml/2011/3/23/417
> >>> - In generic_smp_call_function_single_interrupt(), check if
> >>> call_single_queue was initialized or not, and just return if not
> >>> initialized.
> >>>
> >>> Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com>
[..]
> >So, list_empty(list)? is always false, if I am not missing something.
>
> No, list_empty(list)? is always *true*.
>
ok, I got it. So list_replace_init() is fine even if q->list is empty. So
when a pending IPI from previous kernel comes, q->list will be empty
and we will simply do nothing. Sounds reaosnable to me.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Thanks
Vivek
next prev parent reply other threads:[~2011-04-07 13:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 16:35 [PATCH v2] generic-ipi: Initialize call_single_queue before enabling interrupt Takao Indoh
2011-03-30 15:19 ` Américo Wang
2011-03-30 15:48 ` Neil Horman
2011-04-06 20:47 ` Vivek Goyal
2011-04-06 22:47 ` Takao Indoh
2011-04-06 22:52 ` Takao Indoh
2011-04-07 13:40 ` Vivek Goyal [this message]
2011-06-16 15:19 ` Takao Indoh
2011-06-17 8:19 ` Ingo Molnar
2011-06-17 15:11 ` Takao Indoh
2011-06-18 21:05 ` [tip:sched/urgent] generic-ipi: Fix kexec boot crash by initializing call_single_queue before enabling interrupts tip-bot for Takao Indoh
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=20110407134046.GA27778@redhat.com \
--to=vgoyal@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=axboe@kernel.dk \
--cc=indou.takao@jp.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miltonm@bga.com \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.com \
--cc=xiyou.wangcong@gmail.com \
/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