awslabs/damo

Support loadable module for DAMON with a separate build config

honggyukim opened this issue · 6 comments

Hi SeongJae,

We had discussion previously at #46 (comment) as follows.

I saw that there is no EXPORT_SYMBOL in the files under mm/damon/* now. Could you please confirm that the live demo with insmodable kernel module in the above youtube link is no longer available?

You're correct, DAMON API is not supporting loadable modules at the moment. I had to export some symbols for only the demo. The exporting change has never been merged into the mainline. Note that that was mainly because we don't have use case, not because we don't want to let loadable modules use DAMON API.

These days, I need to keep modifying my kernel implementation based on DAMON, but it's hard to modify and replace the kernel frequently in the real machine for the testing.

For frequent test and evaluation, I feel it'd be useful to have EXPORT_SYMBOL under mm/damon/*. But I know that it's not acceptable by kernel community members so I'm wondering if it's possible to have those EXPORT_SYMBOL only when a specific build config, for example CONFIG_DAMON_EXPORT_SYMBOL, is enabled as a debugging feature?

If this feature is supported then I think I can write and test more DAMON features during development stages.

I would like to hear that if this approach is acceptable or not.

Thanks!

sj-aws commented

I'm not that against at adding EXPORT_SYMBOL(). Having an in-tree module that indeed using the symbols would be ideal, though.

But, if this is only for testing, why don't you add a downstream patch for exporting the symbols?

But, if this is only for testing, why don't you add a downstream patch for exporting the symbols?

That sounds also right. This is not a strong request so I can simply close it. :)

sj-aws commented

Thank you for the update, Honggyu! Just FYI. There were similar questions from other users, too. I'm now considering adding the module examples that I wrote with the live coding in mainline under sample/ directory and adding EXPORT_SYMBOL() for those.

Thanks. That would be useful even if it's for debugging purpose.

sjp38 commented

FYI. DAMON might support loadable modules from Linux v6.8 (https://lore.kernel.org/damon/20231121053604.60798-1-sj@kernel.org/)

sj-aws commented

FWIW, I just sent the official patchset for supporting use of DAMON from loadable modules (https://lore.kernel.org/damon/20231205022858.1540-1-sj@kernel.org/). Since the previous RFC patchset received no objection or concern, hopefully this will be merged in v6.8 Linux kernel.