• Tony Luck's avatar
    perf/x86/mbm: Add memory bandwidth monitoring event management · 87f01cc2
    Tony Luck authored
    Includes all the core infrastructure to measure the total_bytes and
    bandwidth.
    
    We have per socket counters for both total system wide L3 external
    bytes and local socket memory-controller bytes. The OS does MSR writes
    to MSR_IA32_QM_EVTSEL and MSR_IA32_QM_CTR to read the counters and
    uses the IA32_PQR_ASSOC_MSR to associate the RMID with the task. The
    tasks have a common RMID for CQM (cache quality of service monitoring)
    and MBM. Hence most of the scheduling code is reused from CQM.
    Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
    [ Restructured rmid_read to not have an obvious hole, removed MBM_CNTR_MAX as its unused. ]
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: default avatarVikas Shivappa <vikas.shivappa@linux.intel.com>
    Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Brian Gerst <brgerst@gmail.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Denys Vlasenko <dvlasenk@redhat.com>
    Cc: H. Peter Anvin <hpa@zytor.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Matt Fleming <matt@codeblueprint.co.uk>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Vince Weaver <vincent.weaver@maine.edu>
    Cc: fenghua.yu@intel.com
    Cc: h.peter.anvin@intel.com
    Cc: ravi.v.shankar@intel.com
    Cc: vikas.shivappa@intel.com
    Link: http://lkml.kernel.org/r/abd7aac9a18d93b95b985b931cf258df0164746d.1457723885.git.tony.luck@intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    87f01cc2
cqm.c 40 KB