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, xen-devel@lists.xen.org,
	jbeulich@suse.com, xen-devel@lists.xenproject.org
Subject: Re: [Resend PATCH 1/2] Xen/Keyhandler: Make keyhandler always run in tasklet
Date: Fri, 30 Sep 2016 14:07:07 -0400	[thread overview]
Message-ID: <20160930180707.GC23341@char.us.oracle.com> (raw)
In-Reply-To: <1475201946-31898-2-git-send-email-tianyu.lan@intel.com>

On Fri, Sep 30, 2016 at 10:19:05AM +0800, Lan Tianyu wrote:
> Keyhandler may run for a long time in a timer handler on the large machine

I am bit lost.

You say 'timer handler' which will imply that there is some form
of 'init_timer' and 'set_timer' that would call the handle_keypress
function?
But I am not seeing it?

Or are you saying that when 'dump_timerq' is invoked?
If so please say that.

> with a lot of physical cpus(E,G keyhandler for dumping timer info) when serial

s/E,G/e.g.g/

> port driver works in the poll mode. When timer interrupt arrives, timer subsystem

s/poll mode/poll mode (via the exception mechanism)/

> runs all timer handlers before programming next timer interrupt. So if timer handler
> runs longer than time for watchdog timeout, the timer handler of watchdog will be

Ah, so this is if a guest has set a timer and we are executing it. Or we have
many of them to go through.

> blocked to feed watchdog and xen hypervisor panics. This patch is to fix the issue
> via always scheduling a tasklet to run keyhandler to avoid timer handler running
> too long.

You say "timer handler" again. But the timer handlers are executed via
timer_softirq_action (which is a softirq, aka triggered by IPI).

And the tasklet will mean that that it gets to be executed _after_ the
do_softirq is done (as softirq.h puts the low numbered ones first, such
as the TIMER_SOFTIRQ)?

So what I think you are saying is that you do not want the 'timer_softirq_action'
to be preempted by the 'dump_timerq' (or any other ones) which will
trip the watchdog timeout. 

If that is the case please put something to that affect in the
commit description.

That begs one question that should be probably answered in the commit
description:

Why can't the dump_timerq or any other keyhandler poke the watchdog
(expose nmi_timer_fn and call that?)

> 
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>

Otherwise the mechanical parts of the patch look good.

> ---
>  xen/common/keyhandler.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
> index 16de6e8..fce52d2 100644
> --- a/xen/common/keyhandler.c
> +++ b/xen/common/keyhandler.c
> @@ -75,7 +75,9 @@ static struct keyhandler {
>  
>  static void keypress_action(unsigned long unused)
>  {
> -    handle_keypress(keypress_key, NULL);
> +    console_start_log_everything();
> +    key_table[keypress_key].fn(keypress_key);
> +    console_end_log_everything();
>  }
>  
>  static DECLARE_TASKLET(keypress_tasklet, keypress_action, 0);
> @@ -87,10 +89,10 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
>      if ( key >= ARRAY_SIZE(key_table) || !(h = &key_table[key])->fn )
>          return;
>  
> -    if ( !in_irq() || h->irq_callback )
> +    if ( h->irq_callback )
>      {
>          console_start_log_everything();
> -        h->irq_callback ? h->irq_fn(key, regs) : h->fn(key);
> +        h->irq_fn(key, regs);
>          console_end_log_everything();
>      }
>      else
> -- 
> 1.7.1
> 

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

  reply	other threads:[~2016-09-30 18:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30  2:19 [Resend PATCH 0/2] Xen: Fix Xen hypervisor panic during dumping timer info on huge machine Lan Tianyu
2016-09-30  2:19 ` [Resend PATCH 1/2] Xen/Keyhandler: Make keyhandler always run in tasklet Lan Tianyu
2016-09-30 18:07   ` Konrad Rzeszutek Wilk [this message]
2016-10-08  3:17     ` Lan Tianyu
2016-10-06 12:52   ` Jan Beulich
2016-10-08  3:26     ` Lan Tianyu
2016-10-10  6:48       ` Jan Beulich
2016-10-10 13:55       ` Konrad Rzeszutek Wilk
2016-10-11  1:42         ` Lan Tianyu
2016-09-30  2:19 ` [Resend PATCH 2/2] Xen/timer: Process softirq during dumping timer info Lan Tianyu
2016-09-30 18:11   ` Konrad Rzeszutek Wilk
2016-10-06 12:56   ` Jan Beulich
2016-10-08  5:28     ` Lan Tianyu

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=20160930180707.GC23341@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=sstabellini@kernel.org \
    --cc=tianyu.lan@intel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --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).