From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Reinette Chatre <reinette.chatre@intel.com>,
James Morse <james.morse@arm.com>, Borislav Petkov <bp@suse.de>
Subject: [PATCH 4.19 33/40] x86/resctrl: Preserve CDP enable over CPU hotplug
Date: Mon, 20 Apr 2020 14:39:43 +0200 [thread overview]
Message-ID: <20200420121505.491872082@linuxfoundation.org> (raw)
In-Reply-To: <20200420121444.178150063@linuxfoundation.org>
From: James Morse <james.morse@arm.com>
commit 9fe0450785abbc04b0ed5d3cf61fcdb8ab656b4b upstream.
Resctrl assumes that all CPUs are online when the filesystem is mounted,
and that CPUs remember their CDP-enabled state over CPU hotplug.
This goes wrong when resctrl's CDP-enabled state changes while all the
CPUs in a domain are offline.
When a domain comes online, enable (or disable!) CDP to match resctrl's
current setting.
Fixes: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support")
Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20200221162105.154163-1-james.morse@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/cpu/intel_rdt.c | 2 ++
arch/x86/kernel/cpu/intel_rdt.h | 1 +
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 13 +++++++++++++
3 files changed, 16 insertions(+)
--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -555,6 +555,8 @@ static void domain_add_cpu(int cpu, stru
d->id = id;
cpumask_set_cpu(cpu, &d->cpu_mask);
+ rdt_domain_reconfigure_cdp(r);
+
if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
kfree(d);
return;
--- a/arch/x86/kernel/cpu/intel_rdt.h
+++ b/arch/x86/kernel/cpu/intel_rdt.h
@@ -567,5 +567,6 @@ void cqm_setup_limbo_handler(struct rdt_
void cqm_handle_limbo(struct work_struct *work);
bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d);
void __check_limbo(struct rdt_domain *d, bool force_free);
+void rdt_domain_reconfigure_cdp(struct rdt_resource *r);
#endif /* _ASM_X86_INTEL_RDT_H */
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -1777,6 +1777,19 @@ static int set_cache_qos_cfg(int level,
return 0;
}
+/* Restore the qos cfg state when a domain comes online */
+void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
+{
+ if (!r->alloc_capable)
+ return;
+
+ if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA])
+ l2_qos_cfg_update(&r->alloc_enabled);
+
+ if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA])
+ l3_qos_cfg_update(&r->alloc_enabled);
+}
+
/*
* Enable or disable the MBA software controller
* which helps user specify bandwidth in MBps.
next prev parent reply other threads:[~2020-04-20 12:50 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 01/40] amd-xgbe: Use __napi_schedule() in BH context Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 02/40] hsr: check protocol version in hsr_newlink() Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 03/40] net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 04/40] net: ipv6: do not consider routes via gateways for anycast address check Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 05/40] net: qrtr: send msgs from local of same id as broadcast Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 06/40] net: revert default NAPI poll timeout to 2 jiffies Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 07/40] net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 08/40] net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 09/40] ovl: fix value of i_ino for lower hardlink corner case Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 10/40] scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 11/40] jbd2: improve comments about freeing data buffers whose page mapping is NULL Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 12/40] pwm: pca9685: Fix PWM/GPIO inter-operation Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 13/40] ext4: fix incorrect group count in ext4_fill_super error message Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 14/40] ext4: fix incorrect inodes per group in " Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 15/40] ASoC: Intel: mrfld: fix incorrect check on p->sink Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 16/40] ASoC: Intel: mrfld: return error codes when an error occurs Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 17/40] ALSA: usb-audio: Filter error from connector kctl ops, too Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 18/40] ALSA: usb-audio: Dont override ignore_ctl_error value from the map Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 19/40] ALSA: usb-audio: Dont create jack controls for PCM terminals Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 20/40] ALSA: usb-audio: Check mapping at creating connector controls, too Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 21/40] keys: Fix proc_keys_next to increase position index Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 22/40] tracing: Fix the race between registering snapshot event trigger and triggering snapshot operation Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 23/40] btrfs: check commit root generation in should_ignore_root Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 24/40] mac80211_hwsim: Use kstrndup() in place of kasprintf() Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 25/40] usb: dwc3: gadget: dont enable interrupt when disabling endpoint Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 26/40] usb: dwc3: gadget: Dont clear flags before transfer ended Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 27/40] drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 28/40] ext4: do not zeroout extents beyond i_disksize Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 29/40] kvm: x86: Host feature SSBD doesnt imply guest feature SPEC_CTRL_SSBD Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 30/40] scsi: target: remove boilerplate code Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 31/40] scsi: target: fix hang when multiple threads try to destroy the same iscsi session Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 32/40] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE Greg Kroah-Hartman
2020-04-20 12:39 ` Greg Kroah-Hartman [this message]
2020-04-20 12:39 ` [PATCH 4.19 34/40] x86/resctrl: Fix invalid attempt at removing the default resource group Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 35/40] wil6210: check rx_buff_mgmt before accessing it Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 36/40] wil6210: ignore HALP ICR if already handled Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 37/40] wil6210: add general initialization/size checks Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 38/40] wil6210: make sure Rx ring sizes are correlated Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 39/40] wil6210: remove reset file from debugfs Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 40/40] mm/vmalloc.c: move area->pages after if statement Greg Kroah-Hartman
2020-04-20 14:17 ` [PATCH 4.19 00/40] 4.19.117-rc1 review Chris Paterson
2020-04-21 9:55 ` Greg Kroah-Hartman
2020-04-20 19:51 ` Guenter Roeck
2020-04-20 22:24 ` Naresh Kamboju
2020-04-21 9:56 ` Greg Kroah-Hartman
2020-04-22 17:53 ` Ben Hutchings
2020-04-21 9:52 ` Jon Hunter
2020-04-21 20:04 ` shuah
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=20200420121505.491872082@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bp@suse.de \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=stable@vger.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).