linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86/intel_rdt: Fix cache pseudo-locking error path cleanup
@ 2018-07-01  5:03 Reinette Chatre
  2018-07-01  5:03 ` [PATCH 1/2] x86/intel_rdt: Move pseudo_lock_region_clear Reinette Chatre
  2018-07-01  5:03 ` [PATCH 2/2] x86/intel_rdt: Fix cleanup of plr structure on error Reinette Chatre
  0 siblings, 2 replies; 5+ messages in thread
From: Reinette Chatre @ 2018-07-01  5:03 UTC (permalink / raw)
  To: tglx, fenghua.yu, tony.luck, vikas.shivappa
  Cc: gavin.hindman, jithu.joseph, dave.hansen, mingo, hpa, x86,
	linux-kernel, Reinette Chatre

Dear Maintainers,

A bug exists in the error handling code during pseudo-lock region creation.
When an error occurs early during pseudo-lock region creation the
pseudo_lock_region struct is not cleaned up properly but remains associated
with the resource group (since it remains in pseudo-locksetup mode).
This partially initialized struct causes problems when other areas
need to obtain resource group data - when partially initialized the
resource group is treated as a pseudo-locked region.

Following is an example of the error being encountered. First a
pseudo-locked region of larger than 4MB is attempted. This fails early
because of lack for support. Since this is not cleaned up properly,
a subsequent attempt fails because it is (incorrectly) believed that
a pseudo-locked region already exists, also the bit_usage file
reports incorrect data.

# mount -t resctrl resctrl /sys/fs/resctrl
# cd /sys/fs/resctrl/
# mkdir p1
# echo 'L3:1=0xffff0' > schemata
# echo pseudo-locksetup > p1/mode
# echo 'L3:1=0xf' > p1/schemata
-bash: echo: write error: Argument list too long
# cat info/last_cmd_status
requested region exceeds maximum size
# echo 'L3:1=0x1' > p1/schemata
-bash: echo: write error: Invalid argument
# cat info/last_cmd_status
pseudo-locked region in hierarchy
# cat info/L3/bit_usage
0=XXSSSSSSSSSSSSSSSSSS;1=XXSSSSSSSSSSSSSSPPPP

After the fixes in this series have been applied:
# mount -t resctrl resctrl /sys/fs/resctrl/
# cd /sys/fs/resctrl/
# mkdir p1
# echo pseudo-locksetup > p1/mode
# echo 'L3:1=0xffff0' > schemata
# echo 'L3:1=0xf' > p1/schemata
-bash: echo: write error: Argument list too long
# cat info/last_cmd_status
requested region exceeds maximum size
# cat info/L3/bit_usage
0=XXSSSSSSSSSSSSSSSSSS;1=XXSSSSSSSSSSSSSS0000
# echo 'L3:1=0x1' > p1/schemata
# cat info/L3/bit_usage
0=XXSSSSSSSSSSSSSSSSSS;1=XXSSSSSSSSSSSSSS000P


Reinette Chatre (2):
  x86/intel_rdt: Move pseudo_lock_region_clear
  x86/intel_rdt: Fix cleanup of plr structure on error

 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c | 68 ++++++++++++---------
 1 file changed, 40 insertions(+), 28 deletions(-)

-- 
2.17.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-03  6:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-01  5:03 [PATCH 0/2] x86/intel_rdt: Fix cache pseudo-locking error path cleanup Reinette Chatre
2018-07-01  5:03 ` [PATCH 1/2] x86/intel_rdt: Move pseudo_lock_region_clear Reinette Chatre
2018-07-03  6:42   ` [tip:x86/cache] x86/intel_rdt: Move pseudo_lock_region_clear() tip-bot for Reinette Chatre
2018-07-01  5:03 ` [PATCH 2/2] x86/intel_rdt: Fix cleanup of plr structure on error Reinette Chatre
2018-07-03  6:43   ` [tip:x86/cache] " tip-bot for Reinette Chatre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).