From patchwork Fri Sep 30 02:19:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 9357397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CBD02607D6 for ; Fri, 30 Sep 2016 02:22:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB68C29D0B for ; Fri, 30 Sep 2016 02:22:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFF5529D11; Fri, 30 Sep 2016 02:22:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ABC7229D0B for ; Fri, 30 Sep 2016 02:22:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpnQM-0007IL-0t; Fri, 30 Sep 2016 02:19:42 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpnQK-0007Ha-Rs for xen-devel@lists.xen.org; Fri, 30 Sep 2016 02:19:40 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id D2/9C-05127-CBBCDE75; Fri, 30 Sep 2016 02:19:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRWlGSWpSXmKPExsXS1tYhr7v79Nt wg67DUhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8b23RUFf3kqFq7sY25gPM/VxcjJISRQIXHg aCcbiC0hwCtxZNkM1i5GDiA7QOLuQa8uRi6gkn5GiXvN01hBatgE1CVOLJ7ICGKLCNhIfHw8l w2kiFngOqNE07XTYIOEBQIlVrfdArNZBFQlJvy/BdbMK+Ai0XHiDjvEAgWJOZNsQMKcAq4SrS evs0Pc4yJx4vEslgmMvAsYGVYxahSnFpWlFukaGeslFWWmZ5TkJmbm6BoamOrlphYXJ6an5iQ mFesl5+duYgSGQj0DA+MOxh3tfocYJTmYlER5ZY++DRfiS8pPqcxILM6ILyrNSS0+xCjDwaEk wet0CignWJSanlqRlpkDDEqYtAQHj5II7yqQNG9xQWJucWY6ROoUo6KUOO8UkIQASCKjNA+uD RYJlxhlpYR5GRkYGIR4ClKLcjNLUOVfMYpzMCoJ81qBTOHJzCuBm/4KaDET0OL8o29AFpckIq SkGhgj9dpCi2ONYlbfXhjRHmVyLSbro0G5wNo2ZbOcHPG3pXtkLzUbGmy9t8NajDcw6+3PG2v O+l/65yRyM2v7X+EbD5wTOh4GLjB+FG8gErazd/38G7EvPn570ukfq/M7N+0qO5vGgk8LTbkS I2/8+Lb4X3Gu7F6DSbXP7/dNuVj0OXeVUNEG+wNKLMUZiYZazEXFiQC46nW6fwIAAA== X-Env-Sender: tianyu.lan@intel.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1475201976!62466848!1 X-Originating-IP: [134.134.136.31] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9799 invoked from network); 30 Sep 2016 02:19:39 -0000 Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Sep 2016 02:19:39 -0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 29 Sep 2016 19:19:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.31,418,1473145200"; d="scan'208"; a="1038439119" Received: from lantianyu-ws.sh.intel.com (HELO localhost) ([10.239.159.159]) by orsmga001.jf.intel.com with ESMTP; 29 Sep 2016 19:19:34 -0700 From: Lan Tianyu To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Fri, 30 Sep 2016 10:19:05 +0800 Message-Id: <1475201946-31898-2-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1475201946-31898-1-git-send-email-tianyu.lan@intel.com> References: <1475201946-31898-1-git-send-email-tianyu.lan@intel.com> Cc: Lan Tianyu , sstabellini@kernel.org, wei.liu2@citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com Subject: [Xen-devel] [Resend PATCH 1/2] Xen/Keyhandler: Make keyhandler always run in tasklet X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Keyhandler may run for a long time in a timer handler on the large machine with a lot of physical cpus(E,G keyhandler for dumping timer info) when serial port driver works in the poll mode. When timer interrupt arrives, timer subsystem 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 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. Signed-off-by: Lan Tianyu --- 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