mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip: x86/cache] fs/resctrl: Split L3 dependent parts out of __mon_event_count()
@ 2026-01-10 19:46 tip-bot2 for Tony Luck
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Tony Luck @ 2026-01-10 19:46 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Reinette Chatre, Tony Luck, Borislav Petkov (AMD), x86, linux-kernel

The following commit has been merged into the x86/cache branch of tip:

Commit-ID:     ad5c2ff75e0c53d2588dfc10eb87458e759b6bbe
Gitweb:        https://git.kernel.org/tip/ad5c2ff75e0c53d2588dfc10eb87458e759b6bbe
Author:        Tony Luck <tony.luck@intel.com>
AuthorDate:    Wed, 17 Dec 2025 09:20:53 -08:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Mon, 05 Jan 2026 10:18:33 +01:00

fs/resctrl: Split L3 dependent parts out of __mon_event_count()

Carve out the L3 resource specific event reading code into a separate helper
to support reading event data from a new monitoring resource.

Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/20251217172121.12030-1-tony.luck@intel.com
---
 fs/resctrl/monitor.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
index 572a992..b5e0db3 100644
--- a/fs/resctrl/monitor.c
+++ b/fs/resctrl/monitor.c
@@ -413,7 +413,7 @@ static void mbm_cntr_free(struct rdt_mon_domain *d, int cntr_id)
 	memset(&d->cntr_cfg[cntr_id], 0, sizeof(*d->cntr_cfg));
 }
 
-static int __mon_event_count(struct rdtgroup *rdtgrp, struct rmid_read *rr)
+static int __l3_mon_event_count(struct rdtgroup *rdtgrp, struct rmid_read *rr)
 {
 	int cpu = smp_processor_id();
 	u32 closid = rdtgrp->closid;
@@ -494,6 +494,17 @@ static int __mon_event_count(struct rdtgroup *rdtgrp, struct rmid_read *rr)
 	return ret;
 }
 
+static int __mon_event_count(struct rdtgroup *rdtgrp, struct rmid_read *rr)
+{
+	switch (rr->r->rid) {
+	case RDT_RESOURCE_L3:
+		return __l3_mon_event_count(rdtgrp, rr);
+	default:
+		rr->err = -EINVAL;
+		return -EINVAL;
+	}
+}
+
 /*
  * mbm_bw_count() - Update bw count from values previously read by
  *		    __mon_event_count().

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-10 19:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-10 19:46 [tip: x86/cache] fs/resctrl: Split L3 dependent parts out of __mon_event_count() tip-bot2 for Tony Luck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®