From patchwork Wed Aug 9 19:38:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Clark X-Patchwork-Id: 9891739 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 43A73602D7 for ; Wed, 9 Aug 2017 19:41:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 357EC28A8D for ; Wed, 9 Aug 2017 19:41:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A44628A91; Wed, 9 Aug 2017 19:41:11 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 B18D128A9A for ; Wed, 9 Aug 2017 19:41:10 +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 1dfWoW-0002UL-AG; Wed, 09 Aug 2017 19:38:44 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfWoV-0002UF-G1 for xen-devel@lists.xenproject.org; Wed, 09 Aug 2017 19:38:43 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id F4/64-03044-2C46B895; Wed, 09 Aug 2017 19:38:42 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRWlGSWpSXmKPExsVyMXThYd1DKd2 RBh3TeCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozlJ7pYC7q4Kn7ffc3cwLiFo4uRi0NIYCaj ROOGf2wgDovAfRaJW9d3soM4EgK/WST+vvzK3MXICeQUSWzecoy1i5EdyM6X2KkJEuUVEJQ4O fMJC4gtJOAp8XjjdUYQm03AXGJ93w4wm0VARWLH/uNMEPUBEvt2n2QDsYUFvCW2H90N1isioC Rxb9VksBpmAWWJE0e2skDYmhKt23+zT2Dkm4Vk3SwkqQWMTKsYNYpTi8pSi3QNLfSSijLTM0p yEzNzdA0NzPRyU4uLE9NTcxKTivWS83M3MQLDigEIdjDe3BhwiFGSg0lJlHeTdmekEF9Sfkpl RmJxRnxRaU5q8SFGGQ4OJQnea8ndkUKCRanpqRVpmTnAAIdJS3DwKInw/gZJ8xYXJOYWZ6ZDp E4xGnNcubLuCxPHlAPbvzAJseTl56VKifOeBCkVACnNKM2DGwSLvEuMslLCvIxApwnxFKQW5W aWoMq/YhTnYFQS5j0OMoUnM68Ebt8roFOYgE6J8O0EOaUkESEl1cDomGuydd3yTXU6xf8SjA2 W6y1fYNDLmxGcVe0Sefmcl/kbA6njibtOV5m8eFJ/f8q/ef/+aCsuDL38PUhxz2QFxuwFwo2H rx0qjqvfX8J+Y5W0VP/y4odOB597XpI8sX9S/p3mNVJTPrUY5hoHL7/5+sBOrxvbr1+LvBxw7 MTchUvve26ZcW/xZCWW4oxEQy3mouJEAL4Dwyi3AgAA X-Env-Sender: christopher.w.clark@gmail.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1502307521!111277496!1 X-Originating-IP: [209.85.161.195] X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21763 invoked from network); 9 Aug 2017 19:38:42 -0000 Received: from mail-yw0-f195.google.com (HELO mail-yw0-f195.google.com) (209.85.161.195) by server-6.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 9 Aug 2017 19:38:42 -0000 Received: by mail-yw0-f195.google.com with SMTP id s143so4895820ywg.4 for ; Wed, 09 Aug 2017 12:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=kMdk6iS3R3Wqo3fnUkvTdfmDMlXkar1xLzZquoNZprk=; b=e/Y6XgF+5tjP12TfxClBrNrHfjzYsivN5x+0eIG1jLEufrqyDiVXod81ZF8VqIZtkh arZ9iYNjjbcHNF5h8EpCFruKMz7GnaYCu5jaSjncaQAb5EJkDA7WpDotbeHei3TIuD6N /qozpxq6jZHzWzMCwwKpaG//6dvh3PjTOTeV/I3eOubU5AjiNb/Qad93weg9MFF7ZZUq wNjgeQlWCKlTAgnvsEwiKG1e3hT1CfB7dHeRJjcda/jIKsLZSswLLMQ6JO8KHWeIHb4t sV5gY1TF9iRs0XrmiXcsYXaSlbPiqlYlUzVJOQRhw6r+5v5UM/8dRhkD5tXI88H6ijkG Kx9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=kMdk6iS3R3Wqo3fnUkvTdfmDMlXkar1xLzZquoNZprk=; b=PJX/k5BxpI2pTxf3vKfXlfjRANho6xB/O5klCsTN8hx5xoXQFwOo6ygfrSDI9NxhZ7 KI5g4hZXyD7Dj50MtmEaLZ4E/UBU/rl+S0uZ1RK5CiTC8BtQ32qZ+X591cy+UpV8O0ok 6XH/on4O9iOKJcQHyOwUXI1SnTXD+hIGBWIuE0njZ9xo7UvMfCOWDCIkFEeaB6/uX9WN wZUPBwkKprfkgrUwmSXPp05Fw3w9wYG0eAi/0JIK7DNOLEs366tb1omfj7gFt6sh5Nqq nn2VhBp9cXkggKBlhv8jGvYFoEozZii8eJ/cNgcvuD/kPu5xSxqZgKlK50LiitUjkN+N 44/g== X-Gm-Message-State: AHYfb5hikNrlChRktFlOxTj//YuD35dV3bvEjm6RwkgQVZ5HPH3GXoNh PWTtuAPhdS2VmbDv/EqkNDjgeccdE2nRCgY= X-Received: by 10.129.99.7 with SMTP id x7mr7473336ywb.92.1502307520681; Wed, 09 Aug 2017 12:38:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.172.25 with HTTP; Wed, 9 Aug 2017 12:38:40 -0700 (PDT) From: Christopher Clark Date: Wed, 9 Aug 2017 12:38:40 -0700 Message-ID: To: xen-devel@lists.xenproject.org Cc: Jan Beulich Subject: [Xen-devel] [PATCH v2] cpufreq: only stop ondemand governor if already started 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 On CPUFREQ_GOV_STOP in cpufreq_governor_dbs, shortcut to return success if the governor is already stopped. Avoid executing dbs_timer_exit, to prevent tripping an assertion within a call to kill_timer on a timer that has not been prepared with init_timer, if the CPUFREQ_GOV_START case has not run beforehand. kill_timer validates timer state: * itself, via BUG_ON(this_cpu(timers).running == timer); * within active_timer, ASSERTing timer->status is within bounds; * within list_del, which ASSERTs timer inactive list membership. Patch is synonymous to an OpenXT patch produced at Citrix prior to June 2014. Signed-off-by: Christopher Clark Reviewed-by: Jan Beulich --- xen/drivers/cpufreq/cpufreq_ondemand.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/cpufreq_ondemand.c index 7fdba03..fe6c63d 100644 --- a/xen/drivers/cpufreq/cpufreq_ondemand.c +++ b/xen/drivers/cpufreq/cpufreq_ondemand.c @@ -273,6 +273,10 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event) break; case CPUFREQ_GOV_STOP: + if ( !this_dbs_info->enable ) + /* Already not enabled */ + break; + dbs_timer_exit(this_dbs_info); dbs_enable--