Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4243712imc; Mon, 25 Feb 2019 01:10:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IZv7c2XfAXVbUjBBJBHDt0m+MGH8n5tiBCCt49ClAn8Sk9oaKVZJJ8ParuKpkg+H1vz0Qvf X-Received: by 2002:aa7:83cb:: with SMTP id j11mr10646638pfn.117.1551085834906; Mon, 25 Feb 2019 01:10:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551085834; cv=none; d=google.com; s=arc-20160816; b=J19ZJHiJCr+mqLE7EcbA6KJFaOns/TNbehjzBR4EzLJwQtWs2kWDMGCJdXYPTq9c+X MOx4eIXQ0nHD7eO980nEPdZgZm1lU3BElfl7Nh3s7Qkjgd42ME0XxoK6U4YqkhIWCiNu nUBXNndKnJ1BfOZ9wgVbzsY4AfnWf7uBeln4Ssl/30YLq0/RimkEoR9kCbvbhKlcipeO uEfZ8E1/kLWjeJ2eBvMeqIYiwuTA3q+I7nXFSmzM8lK+Si3YZJdHtt9RWIa9ei+Ku+uy byoaqrryyW7+8q2uJ3KfTgS8kdbLeLeuYpQYlYMzwNUVNZil9BTjipRZyKym2uWXfSVZ iBtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LHAbSUS+P+5f24kL/DzQ7EgofGLqa0YK/KJ7xMMErDg=; b=f3BEPlelWNopRA6nrqhXaoevUKuEjIAOtwqtaFCRHJWZcW3cgf81/5UPoppr6o/OhH q3aTOBJ0w/WzEVBR8TqXmNdL7TIvmrVvnTsMyNORWC98MJ0yyOAy3Gl9ZL2ldJ11jANG jyUD+92TfdoOunkiQkp8Y8U5pEX/669GTpB/7z8RGO7f55tOTy/wu8Ufp9qx+DjjopCD EWldTz2bUivY2cp1EfGJN1HNZbxNauEggf0lechLYw+1D836Q/hetIMUfZRs28WqIEAd 95W/DD5xlCrzdOg6M3dXdLPvlNctv4yZNwzNWAiFEQ49JpJWgis5NwNFhefIJ582dGqE iq0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kr+FDfO8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k16si6126984pfj.174.2019.02.25.01.10.19; Mon, 25 Feb 2019 01:10:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kr+FDfO8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726388AbfBYJKA (ORCPT + 99 others); Mon, 25 Feb 2019 04:10:00 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36099 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbfBYJJ7 (ORCPT ); Mon, 25 Feb 2019 04:09:59 -0500 Received: by mail-pl1-f196.google.com with SMTP id k2so4218533plt.3 for ; Mon, 25 Feb 2019 01:09:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LHAbSUS+P+5f24kL/DzQ7EgofGLqa0YK/KJ7xMMErDg=; b=kr+FDfO8l32s+fgO+UM/JrYvaor8ctJbYS46X7tw/NqXdEZ6hrcwEulsY67l2wrx3I MGL4gNp7gJtNRS4l8qgk+P6TC1SUVeTUlDvBLZZZmjgGvemINVzLmfIZK+oB0YbfOsZH aVxEuRFgniELaKetCgjGP8Sd7MamoFw/eWSdHnRz9jONzt5tK/s0jmWAGvsWYd3uc137 hrAPMw02E1989xCR6zpEdIBetrC1o2PbUZkgeDSLqOfej+RMdYabxH94oDxMwiJ4I2Yf 57o/5+m5SK34q3WJOZ6zTQWO2U6MlyNuIeb/QGiLGbXZfbRkNf9FcjIG5iw3p6GkO/Qh YBbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LHAbSUS+P+5f24kL/DzQ7EgofGLqa0YK/KJ7xMMErDg=; b=sO2OR0S8U5nPbpcEZwhgeYq/a22qfEOh5eUb4sqOwCWyHBxNfrcZJY7T9yNW8TntJc cCttYnW1ug78o0NYZMtFI4o7QGIu/kHrDICTBhErFST//MQIhSr2czErPDA+mfhIaUGF 5AXZMzXwxcyeGkl/uLWLZcKebeYHBIGVgRtzXJMdqoQwUpHLVgG5HoYkqlEC4FrJhfIT nLcabQCjGZZduTd2gzXDs4A256JOrrpDg+mDGxyDPF9l4CaNbY+7GJDn+2o7YzR5xNcd tMpbevgaYhLPYf7+uexbN3qOrqNGmXJAbRYSdS/VWOJLiSPrpqKu74nInD1wDlE7NeFE aM7Q== X-Gm-Message-State: AHQUAua2ri5rcLEsJFcCxuE7qadu2E1oXI4/BzLUJFEYfRjo1tJcloi2 VbzbUtx0FQ7SUi9FiIl16Z9Mjw== X-Received: by 2002:a17:902:784c:: with SMTP id e12mr19123197pln.117.1551085798738; Mon, 25 Feb 2019 01:09:58 -0800 (PST) Received: from localhost ([122.167.168.92]) by smtp.gmail.com with ESMTPSA id k74sm21559732pfb.172.2019.02.25.01.09.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 01:09:57 -0800 (PST) Date: Mon, 25 Feb 2019 14:39:55 +0530 From: Viresh Kumar To: Qais Yousef Cc: Rafael Wysocki , linux-pm@vger.kernel.org, Vincent Guittot , mka@chromium.org, juri.lelli@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 4/5] cpufreq: Register notifiers with the PM QoS framework Message-ID: <20190225090955.suq4jw26d2brkjha@vireshk-i7> References: <20190222114446.cmwoe7tanxvf2gxh@e107158-lin.cambridge.arm.com> <20190225043149.bfl5vdb57xaaje2w@vireshk-i7> <20190225085847.yvrtmxtwvk725b7v@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190225085847.yvrtmxtwvk725b7v@e107158-lin.cambridge.arm.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25-02-19, 08:58, Qais Yousef wrote: > On 02/25/19 10:01, Viresh Kumar wrote: > > > > + min = dev_pm_qos_read_value(cpu_dev, DEV_PM_QOS_MIN_FREQUENCY); > > > > + max = dev_pm_qos_read_value(cpu_dev, DEV_PM_QOS_MAX_FREQUENCY); > > > > + > > > > + if (min > new_policy->min) > > > > + new_policy->min = min; > > > > + if (max < new_policy->max) > > > > + new_policy->max = max; > And this is why we need to check here if the PM QoS value doesn't conflict with > the current min/max, right? Until the current notifier code is removed they > could trip over each others. No. The above if/else block is already removed as part of patch 5/5. It was required because of conflict between userspace specific min/max and qos min/max, which are migrated to use qos by patc 5/5. The cpufreq notifier mechanism already lets users play with min/max and that is already safe from conflicts. > It would be nice to add a comment here about PM QoS managing and remembering > values I am not sure if that would add any value. Some documentation update may be useful for people looking for details though, that I shall do after all the changes get in and things become a bit stable. > and that we need to be careful that both mechanisms don't trip over > each others until this transient period is over. The second mechanism will die very very soon once this is merged, migrating them shouldn't be a big challenge AFAICT. I didn't attempt that because I didn't wanted to waste time updating things in case this version also doesn't make sense to others. > I have a nit too. It would be nice to explicitly state this is > CPU_{MIN,MAX}_FREQUENCY. I can see someone else adding {MIN,MAX}_FREQUENCY for > something elsee (memory maybe?) This is not CPU specific, but any device. The same interface shall be used by devfreq as well, who wanted to use freq-constraints initially. > Although I looked at the previous series briefly, but this one looks more > compact and easier to follow, so +1 for that. Thanks for looking into this Qais. -- viresh