mm/damon: Implementation for paused kdamond
Subsystems (2)
Hi SJ,
I noticed that the current implementation for paused kdamond is periodically applies online parameter updates by kdamond_usleep().
I'd like to know if we should change it to waitqueue to achieve a lower power consumption?
Previous Discussion
===================
I noticed that when you introduced ctx->pause [1], Sashiko asked the same question, and your response at the time was:
"sample internval is 5ms by default and recommended auto-tuning setup makes it hundreds of milliseconds. So I don't think such change is required."
I'm curious that, did you think it wasn't neccessary to change it to waitqueue when it was introduced, or it wasn't neccessary to do so even after it had been introduced?
Asussmption
===========
This is just my assumption, not a real use case I knew: When 'pause' is set on an Android device, user might want DAMON to stop running completely when the screen is off, thereby reducing the load on the CPU without losing important information such as regions and age.
The current polling may make it harder for the phone to enter idle mode, resulting in some unnecessary power consumption.
However, pause feature is only present in the stable version v7.2 or higher, and since the latest Android kernel is 6.18, this highly unlikely will affect any Android users.
[1] https://lore.kernel.org/damon/[email protected]
Best regards,
Rui Yan
SJ Park
maintainerQuoted 7 lines · On Mon, 14 Sep 2026 23:35:10 +0800 Liew Rui Yan <[email protected]>…
Hi SJ,
I noticed that the current implementation for paused kdamond is periodically applies online parameter updates by
kdamond_usleep().I'd like to know if we should change it to waitqueue to achieve a lower power consumption?
I'd like to make a data driven decision :)
Quoted 7 lines
Previous Discussion
===================I noticed that when you introduced
ctx->pause[1], Sashiko asked the same question, and your response at the time was:
Quoted 7 lines
"sample internval is 5ms by default and recommended auto-tuning setup makes it hundreds of milliseconds. So I don't think such change is required."
I'm curious that, did you think it wasn't neccessary to change it to waitqueue when it was introduced, or it wasn't neccessary to do so even after it had been introduced?
I guess I thought so when the quiestion is raised.
Quoted 9 lines
Asussmption
===========This is just my assumption, not a real use case I knew: When 'pause' is set on an Android device, user might want DAMON to stop running completely when the screen is off, thereby reducing the load on the CPU without losing important information such as regions and age.
Quoted 6 lines
The current polling may make it harder for the phone to enter idle mode, resulting in some unnecessary power consumption.
However, pause feature is only present in the stable version v7.2 or higher, and since the latest Android kernel is 6.18, this highly unlikely will affect any Android users.
If whoever comes with a data that require changes, we can discuss.
Quoted 2 lines
Thanks,
SJ
[...]
Quoted 38 lines · On Mon, 14 Sep 2026 17:28:35 -0700 SJ Park <[email protected]> wrote:
Quoted 7 lines · On Mon, 14 Sep 2026 23:35:10 +0800 Liew Rui Yan <[email protected]>…
Hi SJ,
I noticed that the current implementation for paused kdamond is periodically applies online parameter updates by
kdamond_usleep().I'd like to know if we should change it to waitqueue to achieve a lower power consumption?
I'd like to make a data driven decision :)
Quoted 7 lines
Previous Discussion
===================I noticed that when you introduced
ctx->pause[1], Sashiko asked the same question, and your response at the time was:Quoted 7 lines
"sample internval is 5ms by default and recommended auto-tuning setup makes it hundreds of milliseconds. So I don't think such change is required."
I'm curious that, did you think it wasn't neccessary to change it to waitqueue when it was introduced, or it wasn't neccessary to do so even after it had been introduced?
I guess I thought so when the quiestion is raised.
Quoted 9 lines
Asussmption
===========This is just my assumption, not a real use case I knew: When 'pause' is set on an Android device, user might want DAMON to stop running completely when the screen is off, thereby reducing the load on the CPU without losing important information such as regions and age.
Quoted 8 lines
Quoted 6 lines
The current polling may make it harder for the phone to enter idle mode, resulting in some unnecessary power consumption.
However, pause feature is only present in the stable version v7.2 or higher, and since the latest Android kernel is 6.18, this highly unlikely will affect any Android users.
If whoever comes with a data that require changes, we can discuss.
Thank you for your clarify.
I recently backported the pause feature to my phone. However, due to Android's screen-off mechanisms, I wasn't able to obtain any valid data during testing.
Since we haven't identified any practical issues with the existing pause feature, switching to waitqueue isn't neccessary at this time.
Regarding the documentation, should we explicitly explain the relationship between 'pause' and sample_interval in the documentation? That way, users can adjust the sample_interval value when using pause feature based on their specific use case.
Quoted 3 lines
Quoted 3 lines
Best regards,
Rui Yan
SeongJae Park
maintainerQuoted 49 lines · On Thu, 17 Sep 2026 23:31:53 +0800 Liew Rui Yan <[email protected]>…
Quoted 38 lines · On Mon, 14 Sep 2026 17:28:35 -0700 SJ Park <[email protected]> wrote:
Quoted 7 lines · On Mon, 14 Sep 2026 23:35:10 +0800 Liew Rui Yan <[email protected]>…
Hi SJ,
I noticed that the current implementation for paused kdamond is periodically applies online parameter updates by
kdamond_usleep().I'd like to know if we should change it to waitqueue to achieve a lower power consumption?
I'd like to make a data driven decision :)
Quoted 7 lines
Previous Discussion
===================I noticed that when you introduced
ctx->pause[1], Sashiko asked the same question, and your response at the time was:Quoted 7 lines
"sample internval is 5ms by default and recommended auto-tuning setup makes it hundreds of milliseconds. So I don't think such change is required."
I'm curious that, did you think it wasn't neccessary to change it to waitqueue when it was introduced, or it wasn't neccessary to do so even after it had been introduced?
I guess I thought so when the quiestion is raised.
Quoted 9 lines
Asussmption
===========This is just my assumption, not a real use case I knew: When 'pause' is set on an Android device, user might want DAMON to stop running completely when the screen is off, thereby reducing the load on the CPU without losing important information such as regions and age.
Quoted 8 lines
Quoted 6 lines
The current polling may make it harder for the phone to enter idle mode, resulting in some unnecessary power consumption.
However, pause feature is only present in the stable version v7.2 or higher, and since the latest Android kernel is 6.18, this highly unlikely will affect any Android users.
If whoever comes with a data that require changes, we can discuss.
Quoted 8 lines
Thank you for your clarify.
I recently backported the pause feature to my phone. However, due to Android's screen-off mechanisms, I wasn't able to obtain any valid data during testing.
Since we haven't identified any practical issues with the existing pause feature, switching to waitqueue isn't neccessary at this time.
Thank you for checking this. I agree.
Quoted 5 lines
Regarding the documentation, should we explicitly explain the relationship between 'pause' and
sample_intervalin the documentation? That way, users can adjust thesample_intervalvalue when using pause feature based on their specific use case.
I think that is too much detail for normal users, unless we find a problem from the lack of the documentation.
Thanks,
SJ
[...]
Quoted 63 lines · On Thu, 17 Sep 2026 19:45:06 -0700 SeongJae Park <[email protected]> wrote:
Quoted 49 lines · On Thu, 17 Sep 2026 23:31:53 +0800 Liew Rui Yan <[email protected]>…
Quoted 38 lines · On Mon, 14 Sep 2026 17:28:35 -0700 SJ Park <[email protected]> wrote:
Quoted 7 lines · On Mon, 14 Sep 2026 23:35:10 +0800 Liew Rui Yan <[email protected]>…
Hi SJ,
I noticed that the current implementation for paused kdamond is periodically applies online parameter updates by
kdamond_usleep().I'd like to know if we should change it to waitqueue to achieve a lower power consumption?
I'd like to make a data driven decision :)
Quoted 7 lines
Previous Discussion
===================I noticed that when you introduced
ctx->pause[1], Sashiko asked the same question, and your response at the time was:Quoted 7 lines
"sample internval is 5ms by default and recommended auto-tuning setup makes it hundreds of milliseconds. So I don't think such change is required."
I'm curious that, did you think it wasn't neccessary to change it to waitqueue when it was introduced, or it wasn't neccessary to do so even after it had been introduced?
I guess I thought so when the quiestion is raised.
Quoted 9 lines
Asussmption
===========This is just my assumption, not a real use case I knew: When 'pause' is set on an Android device, user might want DAMON to stop running completely when the screen is off, thereby reducing the load on the CPU without losing important information such as regions and age.
Quoted 8 lines
Quoted 6 lines
The current polling may make it harder for the phone to enter idle mode, resulting in some unnecessary power consumption.
However, pause feature is only present in the stable version v7.2 or higher, and since the latest Android kernel is 6.18, this highly unlikely will affect any Android users.
If whoever comes with a data that require changes, we can discuss.
Quoted 8 lines
Thank you for your clarify.
I recently backported the pause feature to my phone. However, due to Android's screen-off mechanisms, I wasn't able to obtain any valid data during testing.
Since we haven't identified any practical issues with the existing pause feature, switching to waitqueue isn't neccessary at this time.
Thank you for checking this. I agree.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Regarding the documentation, should we explicitly explain the relationship between 'pause' and
sample_intervalin the documentation? That way, users can adjust thesample_intervalvalue when using pause feature based on their specific use case.I think that is too much detail for normal users, unless we find a problem from the lack of the documentation.
All right, since no normal users seems confused by how the pause feature works right now, add documentation isn't necessary at this time. Thank you for your guidance.
Best regards,
Rui Yan