From patchwork Wed Aug 9 17:21:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Clark X-Patchwork-Id: 9891391 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 6368F603F2 for ; Wed, 9 Aug 2017 17:24:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B25B287D5 for ; Wed, 9 Aug 2017 17:24:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FF40288E7; Wed, 9 Aug 2017 17:24:06 +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 BB7B528832 for ; Wed, 9 Aug 2017 17:24:05 +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 1dfUfP-0002DS-DM; Wed, 09 Aug 2017 17:21:11 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfUfO-0002DM-H0 for xen-devel@lists.xenproject.org; Wed, 09 Aug 2017 17:21:10 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id 4D/CF-03557-5844B895; Wed, 09 Aug 2017 17:21:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHIsWRWlGSWpSXmKPExsVyMXThEd1Wl+5 Ig563vBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aMn99ZC+5zV8x8u5q5gbGHq4uRi0NIYCaj xLZX99lBHBaBBlaJd7/OMYI4EgJzWCW6tx8GynACOXkSW77tZYawSyTedkwFi/MKCEqcnPmEB cQWEvCUmHj0AROIzSlgL/F20W8miBUtjBKN/X9YQRJsAuYS6/t2MILYLAIqEjPvrmOCGBQg8X X9GbC4sICPxKebi8HqRQSUJXp//QZbwCygJLH/7DVGCFtTonX7b/YJjAKzkNwxC0lqASPTKkb 14tSistQiXRO9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYzAUGQAgh2M3Zf9DzFK cjApifJu0u6MFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBK+3cHSkkWJSanlqRlpkDjAqYtAQHj 5II73UnoDRvcUFibnFmOkTqFKMxx5Ur674wcUw5sP0LkxBLXn5eqpQ4rxjIJAGQ0ozSPLhBsG i9xCgrJczLCHSaEE9BalFuZgmq/CtGcQ5GJWHeCJApPJl5JXD7XgGdwgR0SoRvJ8gpJYkIKak GxuB5Z9c6uqoH+PdXfZt3zXFt0ckKscqAPQapFTfslJ0PX3PVnCzt//NwR1Dx14KmGsYj+vH/ s5zLLCWnrBISX8H2f/1TnoYY40UdE7++/rtmUmx3xz3BVNYtn3kCVnXeuGR1/MYBpoLcYCVZF odV0R1xQUwP2hNko7wjMppuHpg7rzCr0qRIiaU4I9FQi7moOBEA6lDnsdECAAA= X-Env-Sender: christopher.w.clark@gmail.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1502299268!77185382!1 X-Originating-IP: [209.85.161.196] 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 60438 invoked from network); 9 Aug 2017 17:21:09 -0000 Received: from mail-yw0-f196.google.com (HELO mail-yw0-f196.google.com) (209.85.161.196) by server-12.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 9 Aug 2017 17:21:09 -0000 Received: by mail-yw0-f196.google.com with SMTP id s143so4679726ywg.4 for ; Wed, 09 Aug 2017 10:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=b3lRlnSiflsMLnvhsBiB4lRhuhTfjZMYUZS3H4lorrM=; b=e0+avkBqQToALNCuJ8Yh9Zd1WMD55XaEAU9CliH9TrZZY9kxd3i7jMAMl+CM82Dezq GIRxbrxZf94hYFC91pHIk/UxhSKLQ2CPtabAq9z1RcFZsEoJR3kP7JIr735r/2Vr11hO nQoCP9Dv+wilDMrL/2OeZSETJuxYdRNWHRZouxHot7NpsMXmsWEMrxQaICAWivSAgd06 M2eF065lILTRUMBXaOEFpT3UBtNlQtdfFbh5EwwUaJJqyFN1pgdAMsbPhz07Yj8PFaoR byBnoSsECgBahaoRNVMUVk5t4CJ4D/Jxi67zy4cf/RWUNsvQGZb7mkwy+nEczp03STjR 1B7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=b3lRlnSiflsMLnvhsBiB4lRhuhTfjZMYUZS3H4lorrM=; b=pXj7ZCMEtDOF07D54tyqZl2c3JVQ0amBmyKe5YIdUE3dXtlg97WzNxuT+94kzEKeMf 4ZLHALWfIK5efx5vYQcND6GMzU8N8kVEt0nK9B/MJExsVAxC8ggQPjsmo4RpiO1tB7A8 tESnH3igVg8ZbEHT8lqtexRuj804Hc+UTSkfDfamvAFcZt80G2647DSU2ysd3INn3s7L /4K8JJbI0lGJjsS3n0xwzrCUwf4+fFmuJmmdCbRl30QB9Gbg87YCbiGCYZ0ayCwT9/ky BeNDRni4lrhJziV4gFuubLKDXxzryt+XDFvIqXIaGf1IOFKOW/i3/tVPiKd75/TUpxm3 4GJQ== X-Gm-Message-State: AHYfb5iKqbFAcLUZjtCWpdw0NCOE42JCEIWCLeo34jfVHAIZHUoeAhuS tU83Prxq29LD4cZKEgzX8eMrujZQWQ== X-Received: by 10.37.194.130 with SMTP id s124mr6781704ybf.360.1502299267819; Wed, 09 Aug 2017 10:21:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.172.25 with HTTP; Wed, 9 Aug 2017 10:21:07 -0700 (PDT) In-Reply-To: <598AF123020000780016E180@prv-mh.provo.novell.com> References: <598AF123020000780016E180@prv-mh.provo.novell.com> From: Christopher Clark Date: Wed, 9 Aug 2017 10:21:07 -0700 Message-ID: To: Jan Beulich Cc: xen-devel@lists.xenproject.org Subject: Re: [Xen-devel] [PATCH] 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 Wed, Aug 9, 2017 at 2:25 AM, Jan Beulich wrote: >>>> On 09.08.17 at 03:57, wrote: >> Avoid panic in cpufreq_gov_stop. > > There's no such function afaics; ... > >> Only execute the CPUFREQ_GOV_STOP logic if the governor has >> actually been started. > > ... all dbs_timer_exit() does is a kill_timer(), so at the very least > the description needs correction. Thanks for the review. I will resend with a corrected description. >> Patch originated in OpenXT. > > With the original author impossible to identify? This patch is a 100% new implementation, written by me, and copyright on it belongs to BAE Systems. A similar patch, with the same effect, that OpenXT uses, has been part of the project source code since the 12th of June, 2014. It was written by an unidentifiable member of staff at Citrix as part of the XenClient project, licensed GPLv2 and delivered to the OpenXT project at its inception. Citrix retains the copyright on that patch, which is reproduced below. https://github.com/OpenXT/xenclient-oe/blob/stable-7/recipes-extended/xen/files/cpufreq_gov_stop_avoid_panic.patch --- xen-4.6.6.orig/xen/drivers/cpufreq/cpufreq_ondemand.c +++ xen-4.6.6/xen/drivers/cpufreq/cpufreq_ondemand.c @@ -273,8 +273,11 @@ int cpufreq_governor_dbs(struct cpufreq_ break; case CPUFREQ_GOV_STOP: - dbs_timer_exit(this_dbs_info); - dbs_enable--; + if (this_dbs_info->enable) + { + dbs_timer_exit(this_dbs_info); + dbs_enable--; + } Christopher