Re: [PATCH v4] cpupower: Implement powercap enabled setters
From: Shuah Khan
Date: Thu Jun 18 2026 - 11:28:16 EST
On 6/17/26 22:18, Mateusz Jaśkiewicz wrote:
> So when you tried to write it worked looks like. The new
Please follow the kernel mailing list convention of posting
at the bottom of the message you are replying you instead
adding your response at the top. You can find the details
in the kernel documentation.
What I meant by "silent failure" is the situation, when we call a function and it just returns success without doing anything (the situation with current implementation).
> value is 1 - what was it before you ran echo 1?
It was 0 before. That being said there are zones that after writing 0 to them remained 1. Should I add check for this and fail if the value remains unchanged despite intention?
Okay so in this case it worked the way it should and the
value changed. When writing 0 (echo 0) to the file, did
you see a message that says "not supported"
I would like to see an concrete use-case for adding the
set enable API. We added this stub when SWIG support was
added.
powercap_set_enabled() could return ENOTSUPP instead of
0 if we don't have a concrete use-case that uses this
API.
Also if you are looking to improve things cpupower,
looks like sysfs_read_file() could be improved. The
return values are inconsistent and confusing. In some
return values aren't checked.
thanks,
-- Shuah