From: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
Dexuan Cui <decui@microsoft.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Subject: RE: [PATCH 1/1] clocksource: hyper-v: Rework clocksource and sched clock setup
Date: Mon, 19 Jun 2023 17:41:20 +0000 [thread overview]
Message-ID: <BYAPR21MB168877B777F93FB6A2453B7DD75FA@BYAPR21MB1688.namprd21.prod.outlook.com> (raw)
In-Reply-To: <07c5efe5-4eb0-121f-7b50-8f3fba68beab@linaro.org>
From: Daniel Lezcano <daniel.lezcano@linaro.org> Sent: Monday, June 19, 2023 9:58 AM
>
> On 19/06/2023 18:44, Michael Kelley (LINUX) wrote:
> > From: Daniel Lezcano <daniel.lezcano@linaro.org> Sent: Monday, June 19, 2023 9:16 AM
> >>
> >> On 09/06/2023 17:47, Michael Kelley wrote:
> >>> Current code assigns either the Hyper-V TSC page or MSR-based ref counter
> >>> as the sched clock. This may be sub-optimal in two cases. First, if there
> >>> is hardware support to ensure consistent TSC frequency across live
> >>> migrations and Hyper-V is using that support, the raw TSC is a faster
> >>> source of time than the Hyper-V TSC page. Second, the MSR-based ref
> >>> counter is relatively slow because reads require a trap to the hypervisor.
> >>> As such, it should never be used as the sched clock. The native sched
> >>> clock based on the raw TSC or jiffies is much better.
> >>>
> >>> Rework the sched clock setup so it is set to the TSC page only if
> >>> Hyper-V indicates that the TSC may have inconsistent frequency across
> >>> live migrations. Also, remove the code that sets the sched clock to
> >>> the MSR-based ref counter. In the cases where it is not set, the sched
> >>> clock will then be the native sched clock.
> >>>
> >>> As part of the rework, always enable both the TSC page clocksource and
> >>> the MSR-based ref counter clocksource. Set the ratings so the TSC page
> >>> clocksource is preferred. While the MSR-based ref counter clocksource
> >>> is unlikely to ever be the default, having it available for manual
> >>> selection is convenient for development purposes.
> >>>
> >>> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> >>
> >> The patch does not apply, does it depend on another patch?
> >
> > It should apply to linux-next. It depends on two previous patches from
> > Peter Zijlstra in the sched/core branch of tip. See:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=sched/core&id=9397fa2ea3e7634f61da1ab76b9eb88ba04dfdfc
> >
> > and
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=sched/core&id=e39acc37db34f6688e2c16e958fb1d662c422c81
>
> Yeah, but the branch is tip/timers/core
>
> Could you respin against it ?
>
Ah, OK. Just to confirm, you are saying that this patch would go through the
tip/timers/core branch, which does *not* have Peter's patches. Resolving the
merge conflict will be done within the tip branches.
Yes, I'll respin for tip/timers/core.
Michael
prev parent reply other threads:[~2023-06-19 17:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 15:47 [PATCH 1/1] clocksource: hyper-v: Rework clocksource and sched clock setup Michael Kelley
2023-06-15 5:15 ` Dexuan Cui
2023-06-19 16:16 ` Daniel Lezcano
2023-06-19 16:44 ` Michael Kelley (LINUX)
2023-06-19 16:58 ` Daniel Lezcano
2023-06-19 17:41 ` Michael Kelley (LINUX) [this message]
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=BYAPR21MB168877B777F93FB6A2453B7DD75FA@BYAPR21MB1688.namprd21.prod.outlook.com \
--to=mikelley@microsoft.com \
--cc=daniel.lezcano@linaro.org \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=wei.liu@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).