On Thu, Jun 12, 2025 at 9:42 PM Huang, Ying <ying.huang@xxxxxxxxxxxxxxxxx> wrote: > > SeongJae Park <sj@xxxxxxxxxx> writes: > > > Hi Bijan, > > > > On Thu, 12 Jun 2025 13:13:26 -0500 Bijan Tabatabai <bijan311@xxxxxxxxx> wrote: > > > >> From: Bijan Tabatabai <bijantabatab@xxxxxxxxxx> > >> > >> A recent patch set automatically set the interleave weight for each node > >> according to the node's maximum bandwidth [1]. In another thread, the patch > >> set's author, Joshua Hahn, wondered if/how these weights should be changed > >> if the bandwidth utilization of the system changes [2]. > > > > Thank you for sharing the background. I do agree it is an important question. > > > >> > >> This patch set adds the mechanism for dynamically changing how application > >> data is interleaved across nodes while leaving the policy of what the > >> interleave weights should be to userspace. It does this by adding a new > >> DAMOS action: DAMOS_INTERLEAVE. We implement DAMOS_INTERLEAVE with both > >> paddr and vaddr operations sets. Using the paddr version is useful for > >> managing page placement globally. Using the vaddr version limits tracking > >> to one process per kdamond instance, but the va based tracking better > >> captures spacial locality. > >> > >> DAMOS_INTERLEAVE interleaves pages within a region across nodes using the > >> interleave weights at /sys/kernel/mm/mempolicy/weighted_interleave/node<N> > >> and the page placement algorithm in weighted_interleave_nid via > >> policy_nodemask. > > > > So, what DAMOS_INTERLEAVE will do is, migrating pages of a given DAMON region > > into multiple nodes, following interleaving weights, right? Hi Ying, > Hi, Bijan, > > It's hard for me to understand what you want to do in your original > patch description. SeongJae's description is helpful. So, can you add > more description in the future version? Yes, sorry about that. I added more detail in my reply to SeongJae and will include more detail in the cover letter of the next revision. > So, you will migrate allocated pages to follow new weight? Yes > How to interact with the weight specified by users explicitly? Usually we will > respect explicit user policy. I am not entirely sure I understand the question completely, but I will try to answer the best I can. We interact with the user provided weights through the policy_nodemask function, which gives us the node id a page should be on. This patch only reads the user provided weights and migrates pages to be consistent with new weights provided by the user, so I believe these changes do respect the explicit user policy. Please let me know if you disagree. Thanks for the review, Bijan P.S. Sorry for sending this twice - I accidentally replied instead of replied all.