-
Notifications
You must be signed in to change notification settings - Fork 8.3k
pm: device_runtime: Optimize pm_device_runtime_usage #81453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There is no point in using lock or semaphore to read current usage counter as it may change after unlocking or giving back the semaphore. Value can only be trusted in the controlled environment (e.g. test). Signed-off-by: Krzysztof Chruściński <[email protected]>
|
While I agree the count should only be used in controlled environment, it is also used in the |
I'm not sure if I understand. Why no leave it as it is? Imo this does not change much for that command. |
|
@ceolin please review as this removed code you introduced. |
|
I don't oppose to this change but I don't see much benefit as well. This function was introduced because of a shell functionality and it is used there and in a test (in the repo). The lock ensures the correctness of the count at the time it was called, obviously as soon as it is retrieved there is not guarantee that it will change. |
I didn't get the point too. The shell is just informative and this change does not impact this functionality. |
There is no point in using lock or semaphore to read current usage counter as it may change after unlocking or giving back the semaphore. Value can only be trusted in the controlled environment (e.g. test).