awslabs / damo

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

_damon_sysfs: Allow enabling two or more kdamonds #78

Closed honggyukim closed 9 months ago

honggyukim commented 9 months ago

The current implementation blocks creating two or more kdamonds using config json file.

It currently fails as follows.

  $ ./damo start two_kdamonds.json
  could not turn on damon (cannot apply kdamonds from args (currently only <=one kdamond is supported))

This patch simply removes the check routine and there is no problem creating two kdamonds using the config json file.

  $ ./damo start two_kdamonds.json

  $ tree -L 2 /sys/kernel/mm/damon/admin/kdamonds
  /sys/kernel/mm/damon/admin/kdamonds
  |-- 0
  |   |-- contexts
  |   |-- pid
  |   `-- state
  |-- 1
  |   |-- contexts
  |   |-- pid
  |   `-- state
  `-- nr_kdamonds

  $ ps aux | grep kdamond
  root      3138  0.0  0.0      0     0 ?        I    04:04   0:00
  [kdamond.0]
  root      3139  0.0  0.0      0     0 ?        I    04:04   0:00
  [kdamond.1]

Closes: #76

honggyukim commented 9 months ago

I've just tested and it makes creating 3 kdamonds also fine.

sj-aws commented 9 months ago

Thank you so much for this awesome PR and the test results, Honggyu!

honggyukim commented 9 months ago

Thanks very much for your help!