awslabs / damo

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

_damon: Add migrate_hot and migrate_cold actions #99

Closed honggyukim closed 2 weeks ago

honggyukim commented 2 weeks ago

Since the implementation for DAMOS_MIGRATE_HOT and DAMOS_MIGRATE_COLD actions are merged into mm-unstable[1], it will likely be available soon in the upstream linux.

So damo has to support those actions and this patch is about it.

[1] https://lore.kernel.org/20240614185328.BA2C1C2BD10@smtp.kernel.org Signed-off-by: Honggyu Kim honggyu.kim@sk.com

sj-aws commented 2 weeks ago

Thank you for this PR. Looks good to me :+1:

honggyukim commented 2 weeks ago

Thanks for merging this, but I found that we also need to provide a way to handle "target_nid" unless migrate actions won't work.

sj-aws commented 2 weeks ago

Yes, indeed. Could you please let me know if you already made the change and gonna send PR for that. If you don't have the plan, I could implement that on my own.

honggyukim commented 2 weeks ago

Thanks. My collegue @yunjeongmun started working on it, but it'd be helpful if you could give her some tips where to modify.

I think we should support the following commands and options

It would be helpful if you tell us what needs to be done more. Thanks!

sj-aws commented 2 weeks ago

started working on it

I thought you may already have the implementation for your testing, and wanted to avoid duplication of efforts. But seems it was not the case. Please let me know if you need any help. I would be happy to implement it from the scratch, if you want.

some tips where to modify.

I may also missed some parts, but I think below changes would be needed.

  1. Damos class in _damon.py should be extended to have a field named target_nid. The constructor and {from,to}_kvpairs() method should also properly be updated.
  2. _damon_args.py would need to be updated to receive target_nid for migrate_{hot,cold} --damos_action. Adding one more option (--damos_target_nid) sounds nice, but I'd prefer letting --damos_action receives two arguments for the case. e.g., damo start --damos_action migrate_hot 2. Specifically, schemes_option_to_damos() and set_damos_argparser() would need to be updated.
  3. _damon_sysfs.py would need to be updated to read/write target_nid value from/to the sysfs file. Specifically, files_content_to_scheme() and write_scheme_dir() would need to be updated.
honggyukim commented 1 week ago

Thanks for your tips. Please see #100.