From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
To: kernelfans@gmail.com, linuxppc-dev@lists.ozlabs.org,
kvm-ppc@vger.kernel.org
Cc: Paul Mackerras <paulus@samba.org>, Alexander Graf <agraf@suse.de>
Subject: Re: [RFC 09/11] powerpc: kvm: handle time base on secondary hwthread
Date: Mon, 27 Oct 2014 12:10:57 +0530 [thread overview]
Message-ID: <544DE8F9.5070100@linux.vnet.ibm.com> (raw)
In-Reply-To: <1413487800-7162-10-git-send-email-kernelfans@gmail.com>
On 10/17/2014 12:59 AM, kernelfans@gmail.com wrote:
> (This is a place holder patch.)
> We need to store the time base for host on secondary hwthread.
> Later when switching back, we need to reprogram it with elapse
> time.
>
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> ---
> arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> index 89ea16c..a817ba6 100644
> --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> @@ -371,6 +371,8 @@ _GLOBAL_TOC(kvmppc_secondary_stopper_enter)
>
> /* fixme: store other register such as msr */
>
> + /* fixme: store the tb, and set it as MAX, so we cease the tick on secondary */
This can lead to serious consequences. First of all, even if we set the
decrementer(not tb) to MAX, it is bound to fire after 4s. That is the
maximum time till which you can keep off the decrementer from firing.
In the hotplug path, the offline cpus nap and their decrementers are
programmed to fire at MAX too. But the difference is that we clear the
LPCR_PECE1 wakeup bit which prevents cpus from waking up on a
decrementer interrupt.
We cannot afford to do this here though because there are other tasks on
the secondary threads' runqueue. They need to be scheduled in.
There are also timers besides the tick_sched one, which can be queued on
these secondary threads. These patches have not taken care to migrate
timers or tasks before entering guest as far as I observed. Hence we
cannot just turn off time base like this and expect to handle the above
mentioned events the next time the primary thread decides to exit to the
host.
Regards
Preeti U Murthy
> +
> /* prevent us to enter kernel */
> li r0, 1
> stb r0, HSTATE_HWTHREAD_REQ(r13)
> @@ -382,6 +384,10 @@ _GLOBAL_TOC(kvmppc_secondary_stopper_enter)
>
> /* enter with vmode */
> kvmppc_secondary_stopper_exit:
> + /* fixme: restore the tb, with the orig val plus time elapse
> + * so we can fire the hrtimer as soon as possible
> + */
> +
> /* fixme, restore the stack which we store on lpaca */
>
> ld r0, 112+PPC_LR_STKOFF(r1)
>
next prev parent reply other threads:[~2014-10-27 6:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 19:29 [RFC 00/11]: powerKVM, release the compute power of secondary hwthread on host kernelfans
2014-10-16 19:29 ` [RFC 01/11] sched: introduce sys_cpumask in tsk to adapt asymmetric system kernelfans
2014-11-12 9:22 ` Srikar Dronamraju
2014-11-18 5:07 ` Liu ping fan
2014-10-16 19:29 ` [RFC 02/11] powerpc: kvm: ensure vcpu-thread run only on primary hwthread kernelfans
2014-11-12 10:17 ` Srikar Dronamraju
2014-10-16 19:29 ` [RFC 03/11] powerpc: kvm: add interface to control kvm function on a core kernelfans
2014-10-27 4:04 ` Preeti U Murthy
2014-11-18 5:17 ` Liu ping fan
2014-11-12 13:01 ` Srikar Dronamraju
2014-10-16 19:29 ` [RFC 04/11] powerpc: kvm: introduce a kthread on primary thread to anti tickless kernelfans
2014-10-27 4:45 ` Preeti U Murthy
2014-11-18 5:24 ` Liu ping fan
2014-10-16 19:29 ` [RFC 05/11] sched: introduce stop_cpus_async() to schedule special tsk on cpu kernelfans
2014-10-16 19:29 ` [RFC 06/11] powerpc: kvm: introduce online in paca to indicate whether cpu is needed by host kernelfans
2014-10-27 5:32 ` Preeti U Murthy
2014-11-18 5:29 ` Liu ping fan
2014-10-16 19:29 ` [RFC 07/11] powerpc: kvm: the stopper func to cease secondary hwthread kernelfans
2014-10-22 7:12 ` Preeti U Murthy
2014-10-27 6:07 ` Preeti U Murthy
2014-10-16 19:29 ` [RFC 08/11] powerpc: kvm: add a flag in vcore to sync primary with secondry hwthread kernelfans
2014-10-27 6:28 ` Preeti U Murthy
2014-10-16 19:29 ` [RFC 09/11] powerpc: kvm: handle time base on secondary hwthread kernelfans
2014-10-27 6:40 ` Preeti U Murthy [this message]
2014-11-18 5:43 ` Liu ping fan
2014-10-16 19:29 ` [RFC 10/11] powerpc: kvm: on_primary_thread() force the secondary threads into NAP mode kernelfans
2014-10-16 19:30 ` [RFC 11/11] powerpc: kvm: Kconfig add an option for enabling secondary hwthread kernelfans
2014-10-27 6:44 ` Preeti U Murthy
2014-11-18 5:47 ` Liu ping fan
2014-11-18 17:54 ` [RFC 00/11]: powerKVM, release the compute power of secondary hwthread on host Alexander Graf
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=544DE8F9.5070100@linux.vnet.ibm.com \
--to=preeti@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=kernelfans@gmail.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.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 NNTP newsgroup(s).