Currently I have added AMD IBS driver as one source that provides
page access information as an example. This driver feeds info to
kpromoted in this RFC patchset. More sources were discussed in a
similar context here at [1].
I was imagining how I would be able to do this with DAMON via operations set
layer interface. And I find thee current interface is not very optimized for
AMD IBS like sources that catches the access on the line. That is, in a way,
we could say AMD IBS like primitives as push-oriented, while page tables'
accessed bits information are pull-oriented. DAMON operations set layer
interface is easier to be used in pull-oriented case. I don't think it cannot
be used for push-oriented case, but definitely the interface would better to be
more optimized for the use case.
I'm curious if you also tried doing this by extending DAMON, and if some hidden
problems you found.
This is just an early attempt to check what it takes to maintain
a single source of page hotness info and also separate hot page
detection mechanisms from the promotion mechanism. There are too
many open ends right now and I have listed a few of them below.
- The API that is provided to register memory access expects
the PFN, NID and time of access at the minimum. This is
described more in patch 2/4. This API currently can be called
only from contexts that allow sleeping and hence this rules
out using it from PTE scanning paths. The API needs to be
more flexible with respect to this.
- Some sources like PTE A bit scanning can't provide the precise
time of access or the NID that is accessing the page. The latter
has been an open problem to which I haven't come across a good
and acceptable solution.
Agree. PTE A bit scanning could be useful in many cases, but not every case.
There was an RFC patchset[7] that extends DAMON for NID. I'm planning to do
that again using DAMON operations layer interface. My current plan is to
implement the prototype using prot_none page faults, and later extend for AMD
IBS like h/w features. Hopefully I will share a prototype or at least more
detailed idea on LSFMMBPF 2025.
- The way the hot page information is maintained is pretty
primitive right now. Ideally we would like to store hotness info
in such a way that it should be easily possible to lookup say N
most hot pages.
DAMON provides a feature for lookup of N most hotpages, namely DAMOS quotas'
access pattern based regions prioritization[5].
- If PTE A bit scanners are considered as hotness sources, we will
be bombarded with accesses. Do we want to accomodate all those
accesses or just go with hotness info for fixed number of pages
(possibly as a ratio of lower tier memory capacity)?
I understand you're saying about memory space overhead. Correct me if I'm
wrong, please.
Isn't same issue exists for current implementation of the sampling frequency is
high, and/or aggregation window is long?
To me, hence, this looks like not a problem of the information source, but how
to maintain the information. Current implementation maintains it per page, so
I think the problem is inherent.
DAMON maintains the information in region abstraction that can save multiple
pages with one data structure. The maximum number of regions can be set by
users, so the space overhead can be controlled.