x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled
[linux-2.6-microblaze.git] / arch / x86 / kernel / cpu / resctrl / monitor.c
index 54dffe5..a98519a 100644 (file)
@@ -279,7 +279,6 @@ static void mbm_bw_count(u32 rmid, struct rmid_read *rr)
                return;
 
        chunks = mbm_overflow_count(m->prev_bw_msr, tval, rr->r->mbm_width);
-       m->chunks += chunks;
        cur_bw = (chunks * r->mon_scale) >> 20;
 
        if (m->delta_comp)
@@ -450,15 +449,14 @@ static void mbm_update(struct rdt_resource *r, struct rdt_domain *d, int rmid)
        }
        if (is_mbm_local_enabled()) {
                rr.evtid = QOS_L3_MBM_LOCAL_EVENT_ID;
+               __mon_event_count(rmid, &rr);
 
                /*
                 * Call the MBA software controller only for the
                 * control groups and when user has enabled
                 * the software controller explicitly.
                 */
-               if (!is_mba_sc(NULL))
-                       __mon_event_count(rmid, &rr);
-               else
+               if (is_mba_sc(NULL))
                        mbm_bw_count(rmid, &rr);
        }
 }