From patchwork Fri Aug 18 18:04:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9909693 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 505636038C for ; Fri, 18 Aug 2017 18:06:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 495F628D14 for ; Fri, 18 Aug 2017 18:06:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E48C28D1D; Fri, 18 Aug 2017 18:06:29 +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 5BC0A28D1D for ; Fri, 18 Aug 2017 18:06:28 +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 1dild7-0002Dg-5n; Fri, 18 Aug 2017 18:04:21 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dild5-0002DK-Vt for xen-devel@lists.xenproject.org; Fri, 18 Aug 2017 18:04:20 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id 28/D4-02177-32C27995; Fri, 18 Aug 2017 18:04:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRWlGSWpSXmKPExsVyMbThkK6SzvR Igz+vpS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyDd2IKVvFUfN34j7WBcTpnFyMXh5DAdEaJ OTuusHYxcnKwCKxhlZh4QggkISFwiVXixbNWRpCEhECcxI89i4FsDiC7UuLPagGQsJCAisTN7 auYIAZ9Z5Q4erqNGSQhLKAnceToD3YIO0Ci59Y9FhCbTcBA4s2OvWDLRASUJO6tmswEYjMLhE rsOPqCCeIIVYkth46C7eUV8Jb4d38O2ExOAR+JFxdPsEIs9pZ493sF2ExRATmJlZdbWCHqBSV OznzCAnIns4CmxPpd+hDj5SW2v53DPIFRZBaSqlkIVbOQVC1gZF7FqFGcWlSWWqRrZKSXVJSZ nlGSm5iZo2toYKqXm1pcnJiempOYVKyXnJ+7iREY+vUMDIw7GPe0+x1ilORgUhLl/T1rSqQQX 1J+SmVGYnFGfFFpTmrxIUYZDg4lCd5oremRQoJFqempFWmZOcAohElLcPAoifCuAEnzFhck5h ZnpkOkTjEac1y5su4LE8eUA9u/MAmx5OXnpUqJ87JrA5UKgJRmlObBDYIlh0uMslLCvIwMDAx CPAWpRbmZJajyrxjFORiVhHn/gizkycwrgdv3CugUJqBTDFungZxSkoiQkmpg9IstW8mWf9T6 8VzdbyeUtl6Q+xrya3PpDKO8iRsnP3p6sP94QEnPtfdbvaz/ZUd2KRZ8d5nC65JonvTWOZ3VS uXCx6PXu9P+aPyzVlF6+GTlz3LFxjWv/zKenhQ/Z+bVGaoFSuJWeRzaykIrF/FFz3ftX/vmUm ZpOdOPCd+Kj1+Y6lwd+vDNSSWW4oxEQy3mouJEAIU42uIJAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1503079458!69074425!1 X-Originating-IP: [209.85.128.194] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6328 invoked from network); 18 Aug 2017 18:04:18 -0000 Received: from mail-wr0-f194.google.com (HELO mail-wr0-f194.google.com) (209.85.128.194) by server-14.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Aug 2017 18:04:18 -0000 Received: by mail-wr0-f194.google.com with SMTP id 49so7924190wrw.5 for ; Fri, 18 Aug 2017 11:04:18 -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=sOocSPj1PjeiBpwbNyWkUXKqfGZ4Rh8E0bPHs+s8gPA=; b=J2Oy+zrlc5/EGK9nOC7/OB0463HjaubQ1RNX6Xy7VJIRi1jvA+FRvDWIDU5jKSGWVg K6PEva1XpssvfEFy7nDkPURmDyuTDtfDenIw9auTnuAAs9Dz6Enk7BzqYLdAfAYXt2kk 5OrmwiiKJYTR0yqQkcpUwAfJ4wMfwmVseOmIgHPnDVNWniehVXM1hz9xAYs/s8LflhcN EQ+rR5i2f8HaQq4JMp95N28s21PvGDepGzfhoSlpfedeTlsW6sC7XF1XQDYCFRXZWdwh IuGlmwOI2kmZ7yZza/gp/01zGu/mGUJoP/2PtAKZLK4+udyDMQQIRKWUZkZ/xH58oJDZ WjAw== 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=sOocSPj1PjeiBpwbNyWkUXKqfGZ4Rh8E0bPHs+s8gPA=; b=YeOm9cVAzRJq7efdj+lSZPPDTDdgFQv6e9fcD1OntQrRS0NPuedRfu9W+ujD4EXQ15 1RPQKy9Ry48EcPfXMGBVda7rxss320XmbuD3XPRdMU6qWxipbhik0dF2Zxib3KqnqzeQ 55NDJb+SthT6GgAs3/dIgZlobtlQtngE97svG/1GouP7U5XlJU/TsCJNxrgHM0cbirNw mVQ+vcdGCi4o9e0+B4N9lAqIsntowWJnpYRpzZGyhnEGlzKmpfUrGezoElCn11mxc9Ty S7qJEC3HVIeo/h3aQBxH5ubpOfNPNTTLbSep2PUOgcPQnkEbLZDjr5yGBB8kWCewRo4i Sw6g== X-Gm-Message-State: AHYfb5gVvVKSAB++ZOv3DvPw+6Wz9If9jyfD3O+jA+vNcO9TyzcwbCaL 6m4+o4QdG40uK7XB X-Received: by 10.223.161.131 with SMTP id u3mr5792389wru.44.1503079457635; Fri, 18 Aug 2017 11:04:17 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.3]) by smtp.gmail.com with ESMTPSA id o24sm2884199wmi.8.2017.08.18.11.04.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Aug 2017 11:04:16 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 18 Aug 2017 20:04:15 +0200 Message-ID: <150307945558.29525.9885476348147421224.stgit@Solace.fritz.box> In-Reply-To: <150307710991.29525.3681195976643263117.stgit@Solace.fritz.box> References: <150307710991.29525.3681195976643263117.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v3 2/6] 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: 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 eeebbdb..2160d2b 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(); /*