> > Maybe assign one of the limited supply of RMIDs for these "unmonitored" > > tasks. Populate a resctrl group named "unmonitored" that lists all the > > unmonitored tasks in a (read-only) "tasks" file. And supply all the counts > > for these tasks in normal looking "mon_data" directory. > > I needed to switch to an rdtgroup struct pointer rather than hardware > IDs in the task structure to indicate group membership[1], otherwise > it's not possible to determine which tasks are in a group when it > doesn't have a unique HW ID value. > > Also this is required for shared assignment so that changing a group's > IDs in a domain only requires updating running tasks rather than > needing to search the entire task list, which would lead to the same > problem we encountered in mongroup rename[2]. Having a pointer to the rdtgroup in the task structure does make file system operations easier. But the cost appears to be more complexity (and memory references) in the context switch code. Your patch[1] seems to do some extra work outside of the static_branch protected sections. So has a cost to context switch even if resctrl is not in use. Chasing pointers "closid = rgrp->mon.parent->closid;" could be expensive when those miss in the cache. > > -Peter > > [1] https://lore.kernel.org/lkml/20240325172707.73966-5-peternewman@xxxxxxxxxx/ > [2] https://lore.kernel.org/lkml/CALPaoCh0SbG1+VbbgcxjubE7Cc2Pb6QqhG3NH6X=WwsNfqNjtA@xxxxxxxxxxxxxx/ -Tony