From patchwork Thu Jul 27 08:01:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9866403 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 DC46C6038C for ; Thu, 27 Jul 2017 08:03:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDB9828780 for ; Thu, 27 Jul 2017 08:03:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2A6728789; Thu, 27 Jul 2017 08:03:52 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID 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 A812728780 for ; Thu, 27 Jul 2017 08:03:51 +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 1dadjX-0000Dr-Sj; Thu, 27 Jul 2017 08:01:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dadjX-0000DS-1k for xen-devel@lists.xenproject.org; Thu, 27 Jul 2017 08:01:23 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id F0/06-03557-2DD99795; Thu, 27 Jul 2017 08:01:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEIsWRWlGSWpSXmKPExsXiVRvkonthbmW kwdvDlhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a9ud1MBQt5Kk7fVGxg7OPsYuTiEBKYyShx 9eEbdhCHRWANq8SCC21gjoTAJVaJw58msHQxcgI5cRK93x4zQ9iVEid+fmUCsYUEVCRubl/FB DHqB9Co4wfAGoQF9CSOHP3BDmH7SLxduIoNxGYTMJB4s2MvK4gtIqAkcW/VZLBBzAKhEjuOvg CzWQRUJRZuWAJWzyvgJHF/4UawOKeAs8TlExtYIBY7SZzeBTFTVEBOYuXlFlaIekGJkzOfANV wAM3UlFi/Sx9ivLzE9rdzmCcwisxCUjULoWoWkqoFjMyrGDWKU4vKUot0Dc30kooy0zNKchMz c3QNDcz0clOLixPTU3MSk4r1kvNzNzECw58BCHYw3t8YcIhRkoNJSZR3kmlFpBBfUn5KZUZic UZ8UWlOavEhRhkODiUJ3vA5lZFCgkWp6akVaZk5wEiESUtw8CiJ8GoAo1GIt7ggMbc4Mx0idY pRl2PSge1fmIRY8vLzUqXEeeeBzBAAKcoozYMbAUsKlxhlpYR5GYGOEuIpSC3KzSxBlX/FKM7 BqCTM6wYyhSczrwRu0yugI5iAjpjYBHZESSJCSqqB0c60TD1T/Nk6wU99UrtbV4TlSopozTgR o3/ys8KOX5rynQ59mVNuH2LfdKbOw9OHa93Sa/XlPZNWMgu5nfw1S3FGuxP/L5aVMXXJr7V8J lz4lVPUs0Gc7+DSnPibylN6Lho+3zAl5922zQax+TYfNN95xJ0M/PzeLH7fv/xNtt3b8p/cvh 94X4mlOCPRUIu5qDgRAEr2o/0FAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1501142480!52108941!1 X-Originating-IP: [74.125.82.68] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8696 invoked from network); 27 Jul 2017 08:01:20 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-6.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 27 Jul 2017 08:01:20 -0000 Received: by mail-wm0-f68.google.com with SMTP id c184so10141768wmd.1 for ; Thu, 27 Jul 2017 01:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=+fcpysB9Cw5yaMS5WDYrF3cs2HaTK3cRWAXnI0SS6ag=; b=ZTKgFBN8DWWuqesQG0WsvNNiFQ2YSCjPC6bU5ytI5sxWm731q4/Om0YiORiDySrZsS brHpAzZcY4L5/QEKPZhxPcnirx6c8F+SACQNbUpkfZIJaA4kn/jOIzpliiHqCHUelCDQ h2Hf4a9bEE1YlsioC/K6tTDfNdudLvzesXeVdVrEZM6optMmpCDjD8YaCf1fJGtEAtiT 86JbAYJeinFVXBXdeWooUuIQyjQUcmubKQBY6QpWHWaQ4YN/0beQYOWczl+zcPPAQ4ar aGN3WMfoYIBeWILZ0SkjSz0RLD5nkWW/esVcsFeU22xAUiV1lhpz0LXA0rgUC3/Vl1Zy Iizw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=+fcpysB9Cw5yaMS5WDYrF3cs2HaTK3cRWAXnI0SS6ag=; b=EB06PytzMMfzqKcquMSdQTP8AFdk7mvpH0mcJZa3sJ41vd7m4qZuYNUL+ohXNl1wOv 5SJMwgcw0+i3J/yojD+1/WYtmwS6d8b/TbMukzMerUJuqlJzttroYYmHE9VZNLBlPMZK lTp1sbLe9yYIjbSjadqvgLKS/tvQbucs4SSMW2xjXqbLS72L69ZeZP8cmAdv3VWGMae2 XqL6T8f2wkB/x1AD+yIIkE5FhWIhrvKuG3WYsQFjoYs3hGJX0Cezxx7P4PtsB7nzT8Ao b7y35SUjGE4nGkIjSYjI5ynOgjD73pW0JbbBBg2fMDoTBupjCyUqA8X5AUWsTHBmcf8x V+fg== X-Gm-Message-State: AIVw111x01Zk6owW91plFm4uCmxaP/fP/LQTrd8gaGtjJHfMOha+Jz2M OT48pP4jxf8fO4k8 X-Received: by 10.28.23.195 with SMTP id 186mr2395383wmx.173.1501142479232; Thu, 27 Jul 2017 01:01:19 -0700 (PDT) Received: from [192.168.0.31] ([80.66.223.212]) by smtp.gmail.com with ESMTPSA id 196sm1614877wmg.36.2017.07.27.01.01.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 01:01:18 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Thu, 27 Jul 2017 10:01:17 +0200 Message-ID: <150114247733.22910.14569496365405374593.stgit@Solace> In-Reply-To: <150114201043.22910.12807057883146318803.stgit@Solace> References: <150114201043.22910.12807057883146318803.stgit@Solace> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH 2/5] xen: ARM: suspend the tick (if in use) when going idle. 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Since commit 964fae8ac ("cpuidle: suspend/resume scheduler tick timer during cpu idle state entry/exit"), if a scheduler has a periodic tick timer, we stop it when going idle. This, however, is only true for x86. Make it true for ARM as well. Signed-off-by: Dario Faggioli Reviewed-by: Stefano Stabellini --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/domain.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 2dc8b0a..fce29cb 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -39,6 +39,25 @@ DEFINE_PER_CPU(struct vcpu *, curr_vcpu); +static void do_idle(void) +{ + unsigned int cpu = smp_processor_id(); + + sched_tick_suspend(); + /* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */ + process_pending_softirqs(); + + local_irq_disable(); + if ( cpu_is_haltable(cpu) ) + { + dsb(sy); + wfi(); + } + local_irq_enable(); + + sched_tick_resume(); +} + void idle_loop(void) { unsigned int cpu = smp_processor_id(); @@ -52,15 +71,7 @@ void idle_loop(void) if ( unlikely(tasklet_work_to_do(cpu)) ) do_tasklet(); else - { - local_irq_disable(); - if ( cpu_is_haltable(cpu) ) - { - dsb(sy); - wfi(); - } - local_irq_enable(); - } + do_idle(); do_softirq(); /*