awslabs / damo

DAMON user-space tool
https://damonitor.github.io/
GNU General Public License v2.0
155 stars 26 forks source link

damo_tune: Ensure reset interval is specified for quota-goals #95

Closed velurimithun closed 5 months ago

velurimithun commented 5 months ago

Description of changes:

While tuning, if user provides 'damos_quota_goal' and not 'reset_interval_ms', throw an error.

Testing: $ ./tests/run.sh ALL passed

Error preview:

[root@ip-172-31-36-123 damo]# damo tune --damos_action pageout --damos_quotas 30 --damos_quota_goal user_input 60 30 --ops vaddr --debug_damon
read '/sys/kernel/mm/damon/admin/kdamonds/nr_kdamonds': '1'
read '/sys/kernel/mm/damon/admin/kdamonds/0/state': 'on'
Tune error: incorrect arguments: 'reset_interval_ms' not specified when setting quota goals
[root@ip-172-31-36-123 damo]# 
sj-aws commented 5 months ago

Thank you for fixing the problem!

Just for a clarification. The reset_interval_ms is set as maximum number by default, so if user sets the goal but reset_interval_ms, the goal is effectively making no effect. This PR prevents such case.