xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Lan, Tianyu" <tianyu.lan@intel.com>
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
	George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] Xen: Force non-irq keyhandler to be run in tasklet when receive a debugkey from serial port
Date: Mon, 24 Oct 2016 10:56:42 -0400	[thread overview]
Message-ID: <20161024145642.GA8840@char.us.oracle.com> (raw)
In-Reply-To: <6b4dec68-42a3-4a1f-de70-e1728b865055@intel.com>

On Mon, Oct 24, 2016 at 10:43:57PM +0800, Lan, Tianyu wrote:
> 
> 
> On 10/24/2016 10:31 PM, Jan Beulich wrote:
> > > > > On 24.10.16 at 16:15, <tianyu.lan@intel.com> wrote:
> > 
> > > 
> > > On 10/24/2016 9:54 PM, Jan Beulich wrote:
> > > > > > > On 24.10.16 at 15:29, <tianyu.lan@intel.com> wrote:
> > > > > On 10/24/2016 8:19 AM, Konrad Rzeszutek Wilk wrote:
> > > > > > On Sat, Oct 22, 2016 at 07:23:03PM +0800, Lan Tianyu wrote:
> > > > > > > __serial_rx() runs in either irq handler or timer handler and non-irq
> > > > > > > keyhandler should not run in these contexts. So always force non-irq
> > > > > > > keyhandler to run in tasklet when receive a debugkey from serial port
> > > > > > 
> > > > > > If the machine is hung with an IRQ handler being stuck, and
> > > > > > one does 'Ctrl-Ax3` followed by 'C' .. which would not be invoked
> > > > > > (as it is not an IRQ handler??
> > > > > 
> > > > > If serial port's interrupt still works in this case, the 'C'
> > > > > keyhandler kexec_crash() will be invoked in a tasklet. This behavior was
> > > > > changed by my patches if includes this patch.
> > > 
> > > Sorry. A typo. I meant the behavior wasn't changed by my patches.
> > 
> > How was it not? The softirq machinery didn't get invoked in that case
> > prior to your patch, afaict.
> > 
> 
> Which softirq? You mean addiing process_pending_softirqs() in the
> dump_timerq()?

The softirq code gets executed _after_ the IRQ handler (do_IRQ) is finished
doing whatever it needs to do.

Which means that if have say:

 1) an errant piece of code that is spinning forever in
    a loop (say in do_IRQ and then perhaps in __do_IRQ_guest?)

 2) The system admin pressed 'Ctrl-A' three times followed by 'C',
    and ends up in the serial code. We schedule the tasklet, which
    calls 'tasklet_schedule_on_cpu' - which means the tasklet will
    only run on _this_ CPU. And then return back to 1)
    code.

 3) The 1) code keeps spinning forever, and we never call do_softirq
    which means we never process the tasklet.

That is the concern I have. I really really need 'C' to work so that
when things go wrong we can analyze the crashdump and figure out what
went wrong. But with your patch I can't create the crash dump.

I may also be wrong - maybe this is not the case and the crash dump
handler runs just fine (which is just fine). In which case please please
explain that in the commit description.

Thanks!


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-10-24 14:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-22 11:23 [PATCH] Xen: Force non-irq keyhandler to be run in tasklet when receive a debugkey from serial port Lan Tianyu
2016-10-24  0:19 ` Konrad Rzeszutek Wilk
2016-10-24 13:29   ` Lan, Tianyu
2016-10-24 13:38     ` Konrad Rzeszutek Wilk
2016-10-24 14:12       ` Lan, Tianyu
2016-10-24 14:29         ` Jan Beulich
2016-10-24 13:54     ` Jan Beulich
2016-10-24 14:15       ` Lan, Tianyu
2016-10-24 14:31         ` Jan Beulich
2016-10-24 14:43           ` Lan, Tianyu
2016-10-24 14:56             ` Konrad Rzeszutek Wilk [this message]
2016-10-24 14:58             ` Jan Beulich
2016-10-24 10:53 ` Jan Beulich
2016-10-24 11:26   ` Wei Liu
2016-10-24 14:01   ` Lan, Tianyu
2016-10-24 14:28     ` Jan Beulich
2016-10-24 15:03       ` Lan, Tianyu
2016-10-24 15:14         ` Jan Beulich

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=20161024145642.GA8840@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tianyu.lan@intel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).