linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] cpupower : Handle set and info subcommands correctly
@ 2019-09-13  8:07 Abhishek Goel
  2019-10-03 14:38 ` shuah
  0 siblings, 1 reply; 5+ messages in thread
From: Abhishek Goel @ 2019-09-13  8:07 UTC (permalink / raw)
  To: linux-pm, linux-kernel; +Cc: shuah, trenn, ego, Abhishek Goel

Cpupower tool has set and info options which are being used only by
x86 machines. This patch removes support for these two subcommands
from generic cpupower utility. Thus, these two subcommands will now be
available only for intel.
This removes the ambiguous error message while using set option in case
of using non-intel systems.

Without this patch on a non-intel box:

root@ubuntu:~# cpupower info
System does not support Intel's performance bias setting

root@ubuntu:~# cpupower set -b 10
Error setting perf-bias value on CPU

With this patch on a non-intel box:

root@ubuntu:~# cpupower info
Supported commands are:
        frequency-info
        frequency-set
        idle-info
        idle-set
        monitor
        help

Same result for set subcommand.

This patch does not affect results on a intel box.

Signed-off-by: Abhishek Goel <huntbag@linux.vnet.ibm.com>
Acked-by: Thomas Renninger <trenn@suse.de>
---

changes from v1:
	Instead of bailing out early in set and info commands, in V2, we
	are cutting out support for these two commands for non-intel
	systems.

 tools/power/cpupower/utils/cpupower.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/power/cpupower/utils/cpupower.c b/tools/power/cpupower/utils/cpupower.c
index 8e3d08042825..babb9ab3afb1 100644
--- a/tools/power/cpupower/utils/cpupower.c
+++ b/tools/power/cpupower/utils/cpupower.c
@@ -52,8 +52,10 @@ static struct cmd_struct commands[] = {
 	{ "frequency-set",	cmd_freq_set,	1	},
 	{ "idle-info",		cmd_idle_info,	0	},
 	{ "idle-set",		cmd_idle_set,	1	},
+#if defined(__x86_64__) || defined(__i386__)
 	{ "set",		cmd_set,	1	},
 	{ "info",		cmd_info,	0	},
+#endif
 	{ "monitor",		cmd_monitor,	0	},
 	{ "help",		cmd_help,	0	},
 	/*	{ "bench",	cmd_bench,	1	}, */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] cpupower : Handle set and info subcommands correctly
  2019-09-13  8:07 [PATCH v2] cpupower : Handle set and info subcommands correctly Abhishek Goel
@ 2019-10-03 14:38 ` shuah
  2019-10-03 22:15   ` shuah
  0 siblings, 1 reply; 5+ messages in thread
From: shuah @ 2019-10-03 14:38 UTC (permalink / raw)
  To: Abhishek Goel, linux-pm, linux-kernel; +Cc: trenn, ego, shuah

On 9/13/19 2:07 AM, Abhishek Goel wrote:
> Cpupower tool has set and info options which are being used only by
> x86 machines. This patch removes support for these two subcommands
> from generic cpupower utility. Thus, these two subcommands will now be
> available only for intel.
> This removes the ambiguous error message while using set option in case
> of using non-intel systems.
> 
> Without this patch on a non-intel box:
> 
> root@ubuntu:~# cpupower info
> System does not support Intel's performance bias setting
> 
> root@ubuntu:~# cpupower set -b 10
> Error setting perf-bias value on CPU
> 
> With this patch on a non-intel box:
> 
> root@ubuntu:~# cpupower info
> Supported commands are:
>          frequency-info
>          frequency-set
>          idle-info
>          idle-set
>          monitor
>          help
> 
> Same result for set subcommand.
> 
> This patch does not affect results on a intel box.
> 
> Signed-off-by: Abhishek Goel <huntbag@linux.vnet.ibm.com>
> Acked-by: Thomas Renninger <trenn@suse.de>
> ---
> 
> changes from v1:
> 	Instead of bailing out early in set and info commands, in V2, we
> 	are cutting out support for these two commands for non-intel
> 	systems.

thanks. I will get this in for 5.4-rc3 veru likely. Definitely in 5.4

-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] cpupower : Handle set and info subcommands correctly
  2019-10-03 14:38 ` shuah
@ 2019-10-03 22:15   ` shuah
  2019-10-14  9:38     ` Abhishek
  0 siblings, 1 reply; 5+ messages in thread
From: shuah @ 2019-10-03 22:15 UTC (permalink / raw)
  To: Abhishek Goel, linux-pm, linux-kernel; +Cc: trenn, ego, shuah

Hi Abhishek,

On 10/3/19 8:38 AM, shuah wrote:
> On 9/13/19 2:07 AM, Abhishek Goel wrote:
>> Cpupower tool has set and info options which are being used only by
>> x86 machines. This patch removes support for these two subcommands
>> from generic cpupower utility. Thus, these two subcommands will now be
>> available only for intel.
>> This removes the ambiguous error message while using set option in case
>> of using non-intel systems.
>>
>> Without this patch on a non-intel box:
>>
>> root@ubuntu:~# cpupower info
>> System does not support Intel's performance bias setting
>>
>> root@ubuntu:~# cpupower set -b 10
>> Error setting perf-bias value on CPU
>>
>> With this patch on a non-intel box:
>>
>> root@ubuntu:~# cpupower info
>> Supported commands are:
>>          frequency-info
>>          frequency-set
>>          idle-info
>>          idle-set
>>          monitor
>>          help
>>
>> Same result for set subcommand.
>>
>> This patch does not affect results on a intel box.
>>
>> Signed-off-by: Abhishek Goel <huntbag@linux.vnet.ibm.com>
>> Acked-by: Thomas Renninger <trenn@suse.de>
>> ---
>>
>> changes from v1:
>>     Instead of bailing out early in set and info commands, in V2, we
>>     are cutting out support for these two commands for non-intel
>>     systems.
> 
> thanks. I will get this in for 5.4-rc3 veru likely. Definitely in 5.4
> 

Okay I almost applied this and decided it needs improvements.

I don't like using #if defined(__x86_64__) || defined(__i386__)

tools/power/cpupower/utils/cpupower.c main() already does this
dynamically using uname(). Please use the same logic do this,
instead of adding compile time code.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] cpupower : Handle set and info subcommands correctly
  2019-10-03 22:15   ` shuah
@ 2019-10-14  9:38     ` Abhishek
  2019-10-14 15:02       ` shuah
  0 siblings, 1 reply; 5+ messages in thread
From: Abhishek @ 2019-10-14  9:38 UTC (permalink / raw)
  To: shuah, linux-pm, linux-kernel; +Cc: trenn, ego

Hi Shuah,


On 10/04/2019 03:45 AM, shuah wrote:
> Hi Abhishek,
>
> On 10/3/19 8:38 AM, shuah wrote:
>> On 9/13/19 2:07 AM, Abhishek Goel wrote:
>>> Cpupower tool has set and info options which are being used only by
>>> x86 machines. This patch removes support for these two subcommands
>>> from generic cpupower utility. Thus, these two subcommands will now be
>>> available only for intel.
>>> This removes the ambiguous error message while using set option in case
>>> of using non-intel systems.
>>>
>>> Without this patch on a non-intel box:
>>>
>>> root@ubuntu:~# cpupower info
>>> System does not support Intel's performance bias setting
>>>
>>> root@ubuntu:~# cpupower set -b 10
>>> Error setting perf-bias value on CPU
>>>
>>> With this patch on a non-intel box:
>>>
>>> root@ubuntu:~# cpupower info
>>> Supported commands are:
>>>          frequency-info
>>>          frequency-set
>>>          idle-info
>>>          idle-set
>>>          monitor
>>>          help
>>>
>>> Same result for set subcommand.
>>>
>>> This patch does not affect results on a intel box.
>>>
>>> Signed-off-by: Abhishek Goel <huntbag@linux.vnet.ibm.com>
>>> Acked-by: Thomas Renninger <trenn@suse.de>
>>> ---
>>>
>>> changes from v1:
>>>     Instead of bailing out early in set and info commands, in V2, we
>>>     are cutting out support for these two commands for non-intel
>>>     systems.
>>
>> thanks. I will get this in for 5.4-rc3 veru likely. Definitely in 5.4
>>
>
> Okay I almost applied this and decided it needs improvements.
>
> I don't like using #if defined(__x86_64__) || defined(__i386__)
>
> tools/power/cpupower/utils/cpupower.c main() already does this
> dynamically using uname(). Please use the same logic do this,
> instead of adding compile time code.
>
> thanks,
> -- Shuah

Do you want the decision to be taken in cpupower-set and cpupower-info
file as was done in v1 but using uname() by identifying the architecture
there itself?

Thanks,
--Abhishek


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] cpupower : Handle set and info subcommands correctly
  2019-10-14  9:38     ` Abhishek
@ 2019-10-14 15:02       ` shuah
  0 siblings, 0 replies; 5+ messages in thread
From: shuah @ 2019-10-14 15:02 UTC (permalink / raw)
  To: Abhishek, linux-pm, linux-kernel; +Cc: trenn, ego, shuah

On 10/14/19 3:38 AM, Abhishek wrote:
> Hi Shuah,
> 
> 
> On 10/04/2019 03:45 AM, shuah wrote:
>> Hi Abhishek,
>>
>> On 10/3/19 8:38 AM, shuah wrote:
>>> On 9/13/19 2:07 AM, Abhishek Goel wrote:
>>>> Cpupower tool has set and info options which are being used only by
>>>> x86 machines. This patch removes support for these two subcommands
>>>> from generic cpupower utility. Thus, these two subcommands will now be
>>>> available only for intel.
>>>> This removes the ambiguous error message while using set option in case
>>>> of using non-intel systems.
>>>>
>>>> Without this patch on a non-intel box:
>>>>
>>>> root@ubuntu:~# cpupower info
>>>> System does not support Intel's performance bias setting
>>>>
>>>> root@ubuntu:~# cpupower set -b 10
>>>> Error setting perf-bias value on CPU
>>>>
>>>> With this patch on a non-intel box:
>>>>
>>>> root@ubuntu:~# cpupower info
>>>> Supported commands are:
>>>>          frequency-info
>>>>          frequency-set
>>>>          idle-info
>>>>          idle-set
>>>>          monitor
>>>>          help
>>>>
>>>> Same result for set subcommand.
>>>>
>>>> This patch does not affect results on a intel box.
>>>>
>>>> Signed-off-by: Abhishek Goel <huntbag@linux.vnet.ibm.com>
>>>> Acked-by: Thomas Renninger <trenn@suse.de>
>>>> ---
>>>>
>>>> changes from v1:
>>>>     Instead of bailing out early in set and info commands, in V2, we
>>>>     are cutting out support for these two commands for non-intel
>>>>     systems.
>>>
>>> thanks. I will get this in for 5.4-rc3 veru likely. Definitely in 5.4
>>>
>>
>> Okay I almost applied this and decided it needs improvements.
>>
>> I don't like using #if defined(__x86_64__) || defined(__i386__)
>>
>> tools/power/cpupower/utils/cpupower.c main() already does this
>> dynamically using uname(). Please use the same logic do this,
>> instead of adding compile time code.
>>
>> thanks,
>> -- Shuah
> 
> Do you want the decision to be taken in cpupower-set and cpupower-info
> file as was done in v1 but using uname() by identifying the architecture
> there itself?
> 

As I recall my objection to the v1 was that it is making the call very
early and bails out. Ideally, I would like to see the change as part
of set/info handling and then print out appropriate message.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-14 15:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13  8:07 [PATCH v2] cpupower : Handle set and info subcommands correctly Abhishek Goel
2019-10-03 14:38 ` shuah
2019-10-03 22:15   ` shuah
2019-10-14  9:38     ` Abhishek
2019-10-14 15:02       ` shuah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).