All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/resctrl: Don't stop walking closids when a locksetup group is found
@ 2019-06-03 17:25 James Morse
       [not found] ` <20190606130802.DD95D20684@mail.kernel.org>
  2019-06-12 12:26 ` [tip:x86/urgent] " tip-bot for James Morse
  0 siblings, 2 replies; 3+ messages in thread
From: James Morse @ 2019-06-03 17:25 UTC (permalink / raw
  To: linux-kernel, x86
  Cc: Fenghua Yu, Reinette Chatre, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H Peter Avin, james.morse

When a new control group is created __init_one_rdt_domain() walks all
the other closids to calculate the sets of used and unused bits.

If it discovers a pseudo_locksetup group, it breaks out of the loop.
This means any later closid doesn't get its used bits added to used_b.
These bits will then get set in unused_b, and added to the new
control group's configuration, even if they were marked as exclusive
for a later closid.

When encountering a pseudo_locksetup group, we should continue. This
is because "a resource group enters 'pseudo-locked' mode after the
schemata is written while the resource group is in 'pseudo-locksetup'
mode." When we find a pseudo_locksetup group, its configuration is
expected to be overwritten, we can skip it.

Fixes: dfe9674b04ff6 ("x86/intel_rdt: Enable entering of pseudo-locksetup mode")
Cc: <stable@vger.kernel.org>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: James Morse <james.morse@arm.com>
---
Changes since v1:
 * Removed braces round multi-line comment and whitespace after the if() block

 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 333c177a2471..869cbef5da81 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -2542,7 +2542,12 @@ static int __init_one_rdt_domain(struct rdt_domain *d, struct rdt_resource *r,
 		if (closid_allocated(i) && i != closid) {
 			mode = rdtgroup_mode_by_closid(i);
 			if (mode == RDT_MODE_PSEUDO_LOCKSETUP)
-				break;
+				/*
+				 * ctrl values for locksetup aren't relevant
+				 * until the schemata is written, and the mode
+				 * becomes RDT_MODE_PSEUDO_LOCKED.
+				 */
+				continue;
 			/*
 			 * If CDP is active include peer domain's
 			 * usage to ensure there is no overlap
-- 
2.20.1


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

* Re: [PATCH v2] x86/resctrl: Don't stop walking closids when a locksetup group is found
       [not found] ` <20190606130802.DD95D20684@mail.kernel.org>
@ 2019-06-07  9:39   ` James Morse
  0 siblings, 0 replies; 3+ messages in thread
From: James Morse @ 2019-06-07  9:39 UTC (permalink / raw
  To: Sasha Levin; +Cc: linux-kernel, x86, Fenghua Yu, stable

Hi,

On 06/06/2019 14:08, Sasha Levin wrote:
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: dfe9674b04ff x86/intel_rdt: Enable entering of pseudo-locksetup mode.
> 
> The bot has tested the following trees: v5.1.7, v5.0.21, v4.19.48.

> v5.1.7: Failed to apply!  Possible dependencies:>     7390619ab9ea ("x86/resctrl: Move per RDT domain initialization to a separate function")
> 
> v5.0.21: Failed to apply! Possible dependencies:
>     7390619ab9ea ("x86/resctrl: Move per RDT domain initialization to a separate function")
That's cleanup, I don't think you want for stable. I'll do a backport.


> v4.19.48: Failed to apply! Possible dependencies:
>     2a7adf6ce643 ("x86/intel_rdt: Fix initial allocation to consider CDP")

This one changed an adjacent line.


>     723f1a0dd8e2 ("x86/resctrl: Fixup the user-visible strings")
>     7390619ab9ea ("x86/resctrl: Move per RDT domain initialization to a separate function")

> How should we proceed with this patch?

I'll come up with backports for v5.1.x/v5.0.x and v4.19.x once this reaches mainline.


Thanks,

James

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

* [tip:x86/urgent] x86/resctrl: Don't stop walking closids when a locksetup group is found
  2019-06-03 17:25 [PATCH v2] x86/resctrl: Don't stop walking closids when a locksetup group is found James Morse
       [not found] ` <20190606130802.DD95D20684@mail.kernel.org>
@ 2019-06-12 12:26 ` tip-bot for James Morse
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for James Morse @ 2019-06-12 12:26 UTC (permalink / raw
  To: linux-tip-commits
  Cc: stable, fenghua.yu, james.morse, hpa, reinette.chatre, mingo, bp,
	tglx, linux-kernel

Commit-ID:  87d3aa28f345bea77c396855fa5d5fec4c24461f
Gitweb:     https://git.kernel.org/tip/87d3aa28f345bea77c396855fa5d5fec4c24461f
Author:     James Morse <james.morse@arm.com>
AuthorDate: Mon, 3 Jun 2019 18:25:31 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 12 Jun 2019 10:31:50 +0200

x86/resctrl: Don't stop walking closids when a locksetup group is found

When a new control group is created __init_one_rdt_domain() walks all
the other closids to calculate the sets of used and unused bits.

If it discovers a pseudo_locksetup group, it breaks out of the loop.  This
means any later closid doesn't get its used bits added to used_b.  These
bits will then get set in unused_b, and added to the new control group's
configuration, even if they were marked as exclusive for a later closid.

When encountering a pseudo_locksetup group, we should continue. This is
because "a resource group enters 'pseudo-locked' mode after the schemata is
written while the resource group is in 'pseudo-locksetup' mode." When we
find a pseudo_locksetup group, its configuration is expected to be
overwritten, we can skip it.

Fixes: dfe9674b04ff6 ("x86/intel_rdt: Enable entering of pseudo-locksetup mode")
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H Peter Avin <hpa@zytor.com>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20190603172531.178830-1-james.morse@arm.com

---
 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 333c177a2471..869cbef5da81 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -2542,7 +2542,12 @@ static int __init_one_rdt_domain(struct rdt_domain *d, struct rdt_resource *r,
 		if (closid_allocated(i) && i != closid) {
 			mode = rdtgroup_mode_by_closid(i);
 			if (mode == RDT_MODE_PSEUDO_LOCKSETUP)
-				break;
+				/*
+				 * ctrl values for locksetup aren't relevant
+				 * until the schemata is written, and the mode
+				 * becomes RDT_MODE_PSEUDO_LOCKED.
+				 */
+				continue;
 			/*
 			 * If CDP is active include peer domain's
 			 * usage to ensure there is no overlap

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

end of thread, other threads:[~2019-06-12 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-03 17:25 [PATCH v2] x86/resctrl: Don't stop walking closids when a locksetup group is found James Morse
     [not found] ` <20190606130802.DD95D20684@mail.kernel.org>
2019-06-07  9:39   ` James Morse
2019-06-12 12:26 ` [tip:x86/urgent] " tip-bot for James Morse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.