All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Marty McFadden <mcfadden8@llnl.gov>
Cc: ak@linux.intel.com, andriy.shevchenko@linux.intel.com,
	bp@alien8.de, bp@suse.de, brgerst@gmail.com,
	dan.j.williams@intel.com, dyoung@redhat.com, hpa@zytor.com,
	linux@horizon.com, linux-kernel@vger.kernel.org, luto@kernel.org,
	mingo@redhat.com, pavel@ucw.cz, tglx@linutronix.de,
	viro@zeniv.linux.org.uk, x86@kernel.org, yu.c.chen@intel.com,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Jiri Olsa <jolsa@redhat.com>
Subject: Re: [PATCH 0/4] MSR: MSR: MSR Whitelist and Batch Introduction
Date: Fri, 26 Feb 2016 08:37:18 +0100	[thread overview]
Message-ID: <20160226073717.GA3884@gmail.com> (raw)
In-Reply-To: <1456444979-224547-1-git-send-email-mcfadden8@llnl.gov>


* Marty McFadden <mcfadden8@llnl.gov> wrote:

> 
> This patch addresses the following two problems:
>   1. The current msr module grants all-or-nothing access to MSRs,
>      thus making user-level runtime performance adjustments 
>      problematic, particularly for power-constrained HPC systems.
> 
>   2. The current msr module requires a separate system call and the
>      acquisition of the preemption lock for each individual MSR access. 
>      This overhead degrades performance of runtime tools that would
>      ideally sample multiple MSRs at high frequencies.

No, we really don't want to touch the old MSR code - it's a very opaque API with 
various deep limitations.

What I'd like to see instead is to use a modern system monitoring interface - and 
in fact that already happened in the last kernel release, we added the perf MSR 
access methods via:

 commit b7b7c7821d932ba18ef6c8eafc8536066b4c2ef4
 Author: Andy Lutomirski <luto@kernel.org>
 Date:   Mon Jul 20 11:49:06 2015 -0400

    perf/x86: Add an MSR PMU driver
    
    This patch adds an MSR PMU to support free running MSR counters. Such
    as time and freq related counters includes TSC, IA32_APERF, IA32_MPERF
    and IA32_PPERF, but also SMI_COUNT.
    
    The events are exposed in sysfs for use by perf stat and other tools.
    The files are under /sys/devices/msr/events/

see arch/x86/cpu/perf/msr.c, or arch/x86/events/msr.c in the latest perf tree:

  git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core

For example with the perf ABIs 'batch access' of a group of MSRs is easy: a group 
of events can be read or sampled at once. It can be done in a system-wide, per 
task or per task hierarchy fashion, with cgroup management as well - it's a modern 
API.

Right now the MSR PMU code is only at its first version, with only these few MSRs 
exposed:

enum perf_msr_id {
        PERF_MSR_TSC                    = 0,
        PERF_MSR_APERF                  = 1,
        PERF_MSR_MPERF                  = 2,
        PERF_MSR_PPERF                  = 3,
        PERF_MSR_SMI                    = 4,

        PERF_MSR_EVENT_MAX,
};

but that can (and should) be expanded and more features can be added.

Thanks,

	Ingo

  parent reply	other threads:[~2016-02-26  7:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  0:02 [PATCH 0/4] MSR: MSR: MSR Whitelist and Batch Introduction Marty McFadden
2016-02-26  0:02 ` [PATCH 1/4] MSR: Prep for separating msr.c into three files Marty McFadden
2016-02-26  2:56   ` kbuild test robot
2016-02-26 10:08   ` Andy Shevchenko
2016-02-26  0:02 ` [PATCH 2/4] " Marty McFadden
2016-02-26  0:02 ` [PATCH 3/4] MSR: msr Whitelist Implementation Marty McFadden
2016-02-26  1:05   ` kbuild test robot
2016-02-26  1:05   ` [PATCH] MSR: fix badzero.cocci warnings kbuild test robot
2016-02-26  0:02 ` [PATCH 4/4] MSR: msr Batch processing feature Marty McFadden
2016-02-26  2:48   ` Andy Lutomirski
2016-03-03 17:21   ` One Thousand Gnomes
2016-03-03 23:09     ` Mcfadden, Marty Jay
2016-02-26  7:37 ` Ingo Molnar [this message]
2016-02-28 18:54   ` [PATCH 0/4] MSR: MSR: MSR Whitelist and Batch Introduction Mcfadden, Marty Jay
2016-02-28 19:01     ` Borislav Petkov
2016-02-29  2:55       ` Mcfadden, Marty Jay
2016-02-29 14:58         ` Borislav Petkov
2016-02-29 16:31           ` Henrique de Moraes Holschuh
2016-02-29 17:22             ` Borislav Petkov
2016-02-29 17:53           ` George Spelvin
2016-02-29 18:20             ` Borislav Petkov
2016-02-29 22:35               ` Mcfadden, Marty Jay
2016-02-29 23:41                 ` Borislav Petkov
2016-03-01 19:01                   ` Rountree, Barry L.
2016-03-03  0:40                     ` Andy Lutomirski
2016-03-01  8:02                 ` Thomas Gleixner
2016-03-01 18:29                   ` Rountree, Barry L.
2016-03-01 18:38                     ` Borislav Petkov
2016-02-29 17:17         ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160226073717.GA3884@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=brgerst@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=luto@kernel.org \
    --cc=mcfadden8@llnl.gov \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.