Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755712AbcC2Bft (ORCPT ); Mon, 28 Mar 2016 21:35:49 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:36418 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750894AbcC2Bfq (ORCPT ); Mon, 28 Mar 2016 21:35:46 -0400 Date: Mon, 28 Mar 2016 18:35:42 -0700 From: Eduardo Valentin To: "Pandruvada, Srinivas" Cc: "Zhang, Rui" , "linux-kernel@vger.kernel.org" , "srikars@nvidia.com" , "linux-pm@vger.kernel.org" , "linux-tegra@vger.kernel.org" , "mlongnecker@nvidia.com" Subject: Re: [PATCH v2] thermal: add sysfs_notify on some attributes Message-ID: <20160329013540.GA15615@localhost.localdomain> References: <1457979156-10972-1-git-send-email-srikars@nvidia.com> <1458079520.4486.39.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1458079520.4486.39.camel@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3047 Lines: 70 On Tue, Mar 15, 2016 at 11:08:00PM +0000, Pandruvada, Srinivas wrote: > On Mon, 2016-03-14 at 11:12 -0700, Srikar Srimath Tirumala wrote: > > Add a sysfs_notify on thermal_zone*/temp and cooling_device*/ > > cur_state whenever any trip is triggered or cur state is changed. > > > > This change allows usermode apps to register themselves to get > > notified, when certain thermal conditions occur and reduce their > > workload. This workload throttling allows usermode to react before > > hardware clocks are throttled and keep some critical apps running > > reliably longer. > I think we need a combination of proposal in? > https://patchwork.kernel.org/patch/7876351/?and this. > > For example this patch notifies that some trip is violated, but that is > not enough for user space application to take any action. Some trips > violations user space may not care as this may be a transient one. The > patch from?Eduardo address that by providing trip, temperature and last > temperature information. But that patch only address hot trips. I > understand why Eduardo doesn't want to be notified for passive trips as > there will be too many. > Yeah, my original intention was to avoid flooding userland, specially through a pipe like the sysfs netlink, which is in use to deal with other stuff. > So IMO we need some mechanism to turn off notification and decide what > notification will result in user space notifications. > On some x86 systems we have 10+ passive/active trips, this will results > in too many notifications. We may be in thermally sensitive zone, where > more code excecution is more heat. > Exactly, that has direct impact not only on the process waiting for thermal notifications, but also on other process listening to sysfs. > We may have some mask of trips for which will result in notifications. > By default no notifications, unless some user space requests. > The complexity of such communication (or even the current status of sysfs ABI) starts to reach limit of such channel. We may definitely consider other means, such as /dev interface, just like IIO does. > During last LPC we discussed about using IIO for temperature threshold > notifications and I submitted multiple changes for that. Looks like we > also care of trip point changes. So I think we need more comprehensive > mechanism to address this. > > May be we should have thermal mini summit during LPC again and decide a > comprehensive plan to address all asynchronous thermal notifications. > I have created a wiki for LPC 2016 http://wiki.linuxplumbersconf.org/2016:thermal Overall I believe we need to solve the (temperature) sensing in a more structured way within the kernel. We have three subsystem that allow performing temperature sensing. They are different in design and concept, but still solve similar problems. I would still prefer to get this better architectured. Of course, we do not need to wait until LPC to start drafting this. Again, please lets generate enough quorum to run the micro conf. BR, Eduardo Valentin