Thread (200 messages) 200 messages, 10 authors, 2025-09-10

Re: [PATCH 28/33] arm_mpam: Track bandwidth counter state for overflow and power management

From: James Morse <james.morse@arm.com>
Date: 2025-09-10 19:29:51
Also in: linux-acpi, linux-arm-kernel, lkml

Hi Fenghua,

On 28/08/2025 01:58, Fenghua Yu wrote:
On 8/22/25 08:30, James Morse wrote:
quoted
Bandwidth counters need to run continuously to correctly reflect the
bandwidth.

The value read may be lower than the previous value read in the case
of overflow and when the hardware is reset due to CPU hotplug.

Add struct mbwu_state to track the bandwidth counter to allow overflow
and power management to be handled.
quoted
@@ -2291,11 +2395,35 @@ static void mpam_unregister_irqs(void)
    static void __destroy_component_cfg(struct mpam_component *comp)
  {
+    struct mpam_msc *msc;
+    struct mpam_vmsc *vmsc;
+    struct mpam_msc_ris *ris;
+
+    lockdep_assert_held(&mpam_list_lock);
+
      add_to_garbage(comp->cfg);
+    list_for_each_entry(vmsc, &comp->vmsc, comp_list) {
+        msc = vmsc->msc;
+
+        mpam_mon_sel_outer_lock(msc);
+        if (mpam_mon_sel_inner_lock(msc)) {
+            list_for_each_entry(ris, &vmsc->ris, vmsc_list)
+                add_to_garbage(ris->mbwu_state);
+            mpam_mon_sel_inner_unlock(msc);
+        }
+        mpam_mon_sel_outer_lock(msc);
s/mpam_mon_sel_outer_lock(msc);/mpam_mon_sel_outer_unlock(msc);/

Or this will hit a dead lock.
Heh, that's a good typo. Thanks!

James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help