Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbbBUXYh (ORCPT ); Sat, 21 Feb 2015 18:24:37 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:33650 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbbBUXYc (ORCPT ); Sat, 21 Feb 2015 18:24:32 -0500 Date: Sun, 22 Feb 2015 00:24:29 +0100 From: Pavel Machek To: Florian Fainelli Cc: Brian Norris , "Rafael J. Wysocki" , Linux Kernel , "linux-pm@vger.kernel.org" , Len Brown , Chirantan Ekbote Subject: Re: [PATCH] PM / sleep: add configurable delay for pm_test Message-ID: <20150221232429.GA3519@amd> References: <1409788535-28264-1-git-send-email-computersforpeace@gmail.com> <20141213025530.GO21347@ld-irv-0074> <20141213083123.GA26129@amd> <20141216235813.GI9759@ld-irv-0074> <20141217080947.GB2027@amd> <20141217091057.GH7112@brian-ubuntu> <20141217092255.GA4588@amd> <20150221203256.GA15228@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 2359 Lines: 58 On Sat 2015-02-21 14:56:01, Florian Fainelli wrote: > 2015-02-21 12:32 GMT-08:00 Pavel Machek : > > > > > > > >> Considering that Brian's change are enclosed within a CONFIG_PM_DEBUG > >> ifdef, can we really use the code bloat as a technical argument here? > > > > Yes. > > Help me understand a few things here: What you are missing is that we try to keep _sources_ small and readable, too. > - if we need to turn on PM_DEBUG all the time, including mainline > distributions, does that mean that: > - portions of code existing only in PM_DEBUG should be > moved out of it because it is actually useful outside of debug option? > - CONFIG_PM itself is not self sufficient and there are > still problems that require PM_DEBUG to be turned on? > - should there be a second level debug option (e.g: > CONFIG_PM_DEBUG_ADV) which gates specific control knobs like PM delay? > > The current 5 seconds delay is completely arbitrary and goes against > the principle of not enforcing a policy, having this configurable > brings this back in the mechanism principle. 5 second delay is arbitrary, and slightly ugly debugging hack, that is acceptable because it is useful, small and unobtrusive. The second you add 40 lines of sysfs glue.. it is no longer small and unobtrusive, and no longer acceptable. And yes, distros probably ship with PM_DEBUG on, and no, adding another config option would not make the big & ugly hack more acceptable. OTOH if you added a hook to kprobes that alowed easy binary patching of the value "5" while not adding 40 lines of overhead, that might be neccessary. Actually, you can probably pull the address from System.map and then just write to it using /dev/mem, no? Just arrange for "5" to be in variable that is in System.map. And you also want to check the kernel parameters, they are modifiable in runtime in at least same cases. But we are not adding 40 lines of uglyness. Clear? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/