From: Reinette Chatre <reinette.chatre@intel.com>
To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com,
vikas.shivappa@linux.intel.com
Cc: gavin.hindman@intel.com, jithu.joseph@intel.com,
dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, linux-kernel@vger.kernel.org,
Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 0/2] x86/intel_rdt: Fix cache pseudo-locking error path cleanup
Date: Sat, 30 Jun 2018 22:03:01 -0700 [thread overview]
Message-ID: <cover.1530421026.git.reinette.chatre@intel.com> (raw)
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
next reply other threads:[~2018-07-01 5:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-01 5:03 Reinette Chatre [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1530421026.git.reinette.chatre@intel.com \
--to=reinette.chatre@intel.com \
--cc=dave.hansen@intel.com \
--cc=fenghua.yu@intel.com \
--cc=gavin.hindman@intel.com \
--cc=hpa@zytor.com \
--cc=jithu.joseph@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=vikas.shivappa@linux.intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).