Skip to content

Commit 92b5d0b

Browse files
aeglbp3tk0v
authored andcommitted
x86/resctrl: Allocate a new field in union mon_data_bits
When Sub-NUMA Cluster (SNC) mode is enabled, the legacy monitor reporting files must report the sum of the data from all of the SNC nodes that share the L3 cache that is referenced by the monitor file. Resctrl squeezes all the attributes of these files into 32 bits so they can be stored in the "priv" field of struct kernfs_node. Currently, only three monitor events are defined by enum resctrl_event_id so reducing it from 8 bits to 7 bits still provides more than enough space to represent all the known event types. But note that this choice was arbitrary. The "rid" field is also far wider than needed for the current number of resource id types. This structure is purely internal to resctrl, no ABI issues with modifying it. Subsequent changes may rearrange the allocation of bits between each of the fields as needed. Give the bit to a new "sum" field that indicates that reading this file must sum across SNC nodes. This bit also indicates that the domid field is the id of an L3 cache (instead of a domain id) to find which domains must be summed. Fix up other issues in the kerneldoc description for mon_data_bits. Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 603cf1e commit 92b5d0b

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

arch/x86/kernel/cpu/resctrl/internal.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,25 @@ struct mon_evt {
127127
};
128128

129129
/**
130-
* union mon_data_bits - Monitoring details for each event file
130+
* union mon_data_bits - Monitoring details for each event file.
131131
* @priv: Used to store monitoring event data in @u
132-
* as kernfs private data
133-
* @rid: Resource id associated with the event file
134-
* @evtid: Event id associated with the event file
135-
* @domid: The domain to which the event file belongs
136-
* @u: Name of the bit fields struct
132+
* as kernfs private data.
133+
* @u.rid: Resource id associated with the event file.
134+
* @u.evtid: Event id associated with the event file.
135+
* @u.sum: Set when event must be summed across multiple
136+
* domains.
137+
* @u.domid: When @u.sum is zero this is the domain to which
138+
* the event file belongs. When @sum is one this
139+
* is the id of the L3 cache that all domains to be
140+
* summed share.
141+
* @u: Name of the bit fields struct.
137142
*/
138143
union mon_data_bits {
139144
void *priv;
140145
struct {
141146
unsigned int rid : 10;
142-
enum resctrl_event_id evtid : 8;
147+
enum resctrl_event_id evtid : 7;
148+
unsigned int sum : 1;
143149
unsigned int domid : 14;
144150
} u;
145151
};

0 commit comments

Comments
 (0)