From: Peter Zijlstra <peterz@infradead.org>
To: Wen Yang <simon.wy@alibaba-inc.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Stephane Eranian <eranian@google.com>,
mark rutland <mark.rutland@arm.com>, jiri olsa <jolsa@redhat.com>,
namhyung kim <namhyung@kernel.org>,
borislav petkov <bp@alien8.de>,
x86@kernel.org, Wen Yang <wenyang@linux.alibaba.com>,
"h. peter anvin" <hpa@zytor.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH 2/2] perf/x86: improve the event scheduling to avoid unnecessary pmu_stop/start
Date: Fri, 4 Mar 2022 16:39:24 +0100 [thread overview]
Message-ID: <YiIyrFn7upPEouVt@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20220304110351.47731-2-simon.wy@alibaba-inc.com>
On Fri, Mar 04, 2022 at 07:03:51PM +0800, Wen Yang wrote:
> this issue has been there for a long time, we could reproduce it as follows:
What issue? You've not described an issue. So you cannot reference one.
This is still completely unreadable gibberish.
> 1, run a script that periodically collects perf data, eg:
> while true
> do
> perf stat -e cache-misses,cache-misses,cache-misses -c 1 sleep 2
> perf stat -e cache-misses -c 1 sleep 2
> sleep 1
> done
>
> 2, run another one to capture the ipc, eg:
> perf stat -e cycles:d,instructions:d -c 1 -i 1000
<snip line noise>
> the reason is that the nmi watchdog permanently consumes one fp
> (*cycles*). therefore, when the above shell script obtains *cycles*
> again, only one gp can be used, and its weight is 5.
> but other events (like *cache-misses*) have a weight of 4,
> so the counter used by *cycles* will often be taken away, as in
> the raw data above:
> [1]
> n_events = 3
> assign = {33, 1, 32, ...}
> -->
> n_events = 6
> assign = {33, 3, 32, 0, 1, 2, ...}
Again unreadable... what do any of those numbers mean?
>
> so it will cause unnecessary pmu_stop/start and also cause abnormal cpi.
How?!?
> Cloud servers usually continuously monitor the cpi data of some important
> services. This issue affects performance and misleads monitoring.
>
> The current event scheduling algorithm is more than 10 years old:
> commit 1da53e023029 ("perf_events, x86: Improve x86 event scheduling")
irrelevant
> we wish it could be optimized a bit.
I wish for a unicorn ...
> The fields msk_counters and msk_events are added to indicate currently
> used counters and events so that the used ones can be skipped
> in __perf_sched_find_counter and perf_sched_next_event functions to avoid
> unnecessary pmu_stop/start.
Still not sure what your actual problem is, nor what the actual proposal
is.
Why should I attempt to reverse engineer your code without basic
understanding of what you're actually trying to achieve?
next prev parent reply other threads:[~2022-03-04 15:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-04 11:03 [RESEND PATCH 1/2] perf/x86: extract code to assign perf events for both core and uncore Wen Yang
2022-03-04 11:03 ` [RESEND PATCH 2/2] perf/x86: improve the event scheduling to avoid unnecessary pmu_stop/start Wen Yang
2022-03-04 15:39 ` Peter Zijlstra [this message]
2022-03-06 14:36 ` Wen Yang
2022-03-07 17:14 ` Stephane Eranian
2022-03-08 6:42 ` Wen Yang
2022-03-08 12:53 ` Peter Zijlstra
2022-03-08 12:50 ` Peter Zijlstra
2022-03-10 3:50 ` Wen Yang
2022-03-14 10:55 ` Peter Zijlstra
2022-03-17 17:54 ` Wen Yang
2022-04-17 15:06 ` Wen Yang
2022-04-19 14:16 ` Wen Yang
2022-04-19 20:57 ` Peter Zijlstra
2022-04-19 21:18 ` Stephane Eranian
2022-04-20 14:44 ` Wen Yang
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=YiIyrFn7upPEouVt@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=simon.wy@alibaba-inc.com \
--cc=tglx@linutronix.de \
--cc=wenyang@linux.alibaba.com \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox