Skip to content

Commit 0b9aa65

Browse files
rchatreKAGA-KOKO
authored andcommitted
x86/intel_rdt: Introduce test to determine if closid is in use
During CAT feature discovery the capacity bitmasks (CBMs) associated with all the classes of service are initialized to all ones, even if the class of service is not in use. Introduce a test that can be used to determine if a class of service is in use. This test enables code interested in parsing the CBMs to know if its values are meaningful or can be ignored. Temporarily mark the function as unused to silence compile warnings until it is used. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/798f8d89cd9b12df492d48c14bdc8ee3b39b1c6f.1529706536.git.reinette.chatre@intel.com
1 parent d48d7a5 commit 0b9aa65

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arch/x86/kernel/cpu/intel_rdt_rdtgroup.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,18 @@ static void closid_free(int closid)
126126
closid_free_map |= 1 << closid;
127127
}
128128

129+
/**
130+
* closid_allocated - test if provided closid is in use
131+
* @closid: closid to be tested
132+
*
133+
* Return: true if @closid is currently associated with a resource group,
134+
* false if @closid is free
135+
*/
136+
static bool __attribute__ ((unused)) closid_allocated(unsigned int closid)
137+
{
138+
return (closid_free_map & (1 << closid)) == 0;
139+
}
140+
129141
/**
130142
* rdtgroup_mode_by_closid - Return mode of resource group with closid
131143
* @closid: closid if the resource group

0 commit comments

Comments
 (0)