From patchwork Wed Aug 16 16:45:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9904151 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 B93A4603B5 for ; Wed, 16 Aug 2017 16:48:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB2D228A1B for ; Wed, 16 Aug 2017 16:48:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FF8A28A4B; Wed, 16 Aug 2017 16:48:14 +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 574FD28A4C for ; Wed, 16 Aug 2017 16:48:14 +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 1di1S0-00020E-ME; Wed, 16 Aug 2017 16:45:48 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1di1Ry-0001zz-Kx for xen-devel@lists.xenproject.org; Wed, 16 Aug 2017 16:45:46 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id B2/9D-01995-9B674995; Wed, 16 Aug 2017 16:45:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRWlGSWpSXmKPExsVyMbThkO7Osim RBq23BCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyDd2IKVvFUfN34j7WBcTpnFyMXh5DADEaJ n8cPsYE4LAJrWCWe33gG5kgIXGKVmDfjFlMXIyeQEyex68cF9i5GDiC7UuLo8wyQsJCAisTN7 auYICZ9Z5T4/3U5O0hCWEBP4sjRH1B2gMTpJXvA5rAJGEi82bGXFcQWEVCSuLdqMlicWSBUYs fRF2A2i4CqxOSn35lBdvEKeEssb6wGCXMK+EosfHCZBWKvj8TBnr2MILaogJzEysstYCN5BQQ lTs58wgLSyiygKbF+lz7EdHmJ7W/nME9gFJmFpGoWQtUsJFULGJlXMWoUpxaVpRbpGhrqJRVl pmeU5CZm5ugaGhjr5aYWFyemp+YkJhXrJefnbmIEhj4DEOxgXP3b6RCjJAeTkiivV/6USCG+p PyUyozE4oz4otKc1OJDjDIcHEoSvDKlQDnBotT01Iq0zBxgFMKkJTh4lER4z4KkeYsLEnOLM9 MhUqcYjTmuXFn3hYljyoHtX5iEWPLy81KlxHkXgZQKgJRmlObBDYIlh0uMslLCvIxApwnxFKQ W5WaWoMq/YhTnYFQS5pUFmcKTmVcCt+8V0ClMQKdcaZ8EckpJIkJKqoGxxMKg93D7uoWvX5o7 RUTdZGU5NmU534mVgbcfCp6/57FFInz/8m0LriowiS8/P+uaOuP9opnSk7+fXeSp0t7/ZebnK VuFr02Vv/pzx5afcTPfdyTH6XJzLZ304Eiov2PwqaRmA627+get9U70vrhUt6cnwtg99zbPmz 080jVGSm+rfrRGOBzkU2Ipzkg01GIuKk4EAK0RyAoJAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1502901945!110301588!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 14737 invoked from network); 16 Aug 2017 16:45:45 -0000 Received: from mail-wr0-f194.google.com (HELO mail-wr0-f194.google.com) (209.85.128.194) by server-3.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Aug 2017 16:45:45 -0000 Received: by mail-wr0-f194.google.com with SMTP id x43so4011038wrb.1 for ; Wed, 16 Aug 2017 09:45:45 -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=TLVpORCRc1NTETN8APNIVydww2GaslnaFk18ku+sqGnTCxOWNFVIQCdlk0ugK1xYwo DODsQgbjz+AVZ0agUQoTxvSpQhrJPMLRjQWEz1xLQpCRlt1OkZA4YomP0Ymm6yDLY+V4 MBSjUFVCYeAbZySSpwbKA5VeaSYds9zpCHxRq9SvSCwn7V5iDCKUTEeTCNzV0VUjZsAk TdCQD8qJYE5GkAImRaCuH8oYVRW1BT1AXku0Pkfui0Q2V9IMs+C6y8/CpZoE5biDL9BR /DZO7z458zoHVhwDyAx/ucK219amztXKse5IVxf4zGYWt8yPEu7+I+nLZpTvBkU/1Afk Ggjw== 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=d+S5GKSjQ3yebLRDQRWNoZau+bKKcPzIcCFWhaH+qTUmlnYJ+yvsead+H9ZCBjf1p1 62pERI9p2HpYODRtk+e++uhqtNa+yTrGD7LUt8FrXvtRysNf8WJrbZfXYaBqN8V+XjPm CudnSuyN+sBOgn5Pqh9qUxohRpaiy0NmaZiv6dzMCeAaZBUi4GzgegQlh0sNkgy4E1ob 7/YopxUTf5VqbzoP1rwistDUY54urJeDVEwMX72yrd9RwRLXFTXI2nb7/Q+67z19xpna 8bkLdOOYaofMoON+IYA0UfJG+67KbHGYfq6PWqanN7V9Gr+TgNZUALI2qK5LPJRQdTuC R2lQ== X-Gm-Message-State: AHYfb5izv+fcLPspIkj2f6zDGT0HW7tEN7xj75H9oTQRpmGzcXuHMa5M cysGFlg2ifoIqM2o X-Received: by 10.223.147.97 with SMTP id 88mr1685781wro.226.1502901944663; Wed, 16 Aug 2017 09:45:44 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.3]) by smtp.gmail.com with ESMTPSA id e9sm1909159wmi.40.2017.08.16.09.45.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 09:45:44 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Wed, 16 Aug 2017 18:45:42 +0200 Message-ID: <150290194281.24854.9441700207015873757.stgit@Solace.fritz.box> In-Reply-To: <150290125292.24854.17418548557562763544.stgit@Solace.fritz.box> References: <150290125292.24854.17418548557562763544.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v2 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(); /*