linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC 00/11]: powerKVM, release the compute power of secondary hwthread on host
@ 2014-10-16 19:29 kernelfans
  2014-10-16 19:29 ` [RFC 01/11] sched: introduce sys_cpumask in tsk to adapt asymmetric system kernelfans
                   ` (11 more replies)
  0 siblings, 12 replies; 30+ messages in thread
From: kernelfans @ 2014-10-16 19:29 UTC (permalink / raw)
  To: linuxppc-dev, kvm-ppc; +Cc: Paul Mackerras, Alexander Graf

Nowadays, when running powerKVM(book3s, hv mode), we should make the secondary hwthread
offline. Which means that if we run misc tsks other than dedicated KVM (e.g mix java and KVM),
we will lose the compute power of the secondary hwthread on host env.


This series aim to make the powerpc adaptive to the misc tsks on host.
( This series is just a sketch, with some broken patch. Sorry to bring up it in a hurry,
  I am afraid that I am on the wrong direction too far. So I hope I can get some advice and feedback
  in advance. I will go on the work on the "place holder" patch if my idea is reasonable.

  Please consider the code as the explaining of my idea.
)


The internal:
  -1.To enter guest, the primary hwthread schedule stopper func on the secondary to bring them into NAP mode.
        The proto will be:
             cpu1                              cpuX
          stop_cpus_async()
                                          bring cpuX to a special state
                                          signal flag and trapped
          check for flag
          set up guest env and ipi cpuX        
  -2.When exit to host, the secondary hardcode to jmp back to the stopper func, i.e back to host.


Drawbacks that I can think so far:
  -1. increase the sched interval on secondary but the schduler do NOT know it.(can it cause problem?)
  -2. lose some presice of hrtime on secondary hwthread for host.(To avoid the primary
       has too small time slice, we need to impose a threshold,so we may lose the presice)

Any suggestion? Thanks!

Liu Ping Fan (11):
  sched: introduce sys_cpumask in tsk to adapt asymmetric system
  powerpc: kvm: ensure vcpu-thread run only on primary hwthread
  powerpc: kvm: add interface to control kvm function on a core
  powerpc: kvm: introduce a kthread on primary thread to anti tickless
  sched: introduce stop_cpus_async() to schedule special tsk on cpu
  powerpc: kvm: introduce online in paca to indicate whether cpu is
    needed by host
  powerpc: kvm: the stopper func to cease secondary hwthread
  powerpc: kvm: add a flag in vcore to sync primary with secondry
    hwthread
  powerpc: kvm: handle time base on secondary hwthread
  powerpc: kvm: on_primary_thread() force the secondary threads into NAP
        mode
  powerpc: kvm: Kconfig add an option for enabling secondary hwthread

 arch/powerpc/include/asm/kvm_host.h     |  6 ++++
 arch/powerpc/include/asm/paca.h         |  3 ++
 arch/powerpc/kernel/asm-offsets.c       |  6 ++++
 arch/powerpc/kernel/smp.c               |  3 ++
 arch/powerpc/kernel/sysfs.c             | 41 ++++++++++++++++++++++
 arch/powerpc/kvm/Kconfig                |  4 +++
 arch/powerpc/kvm/book3s_hv.c            | 39 +++++++++++++++++++++
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 61 +++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/xics/xics-common.c  | 12 +++++++
 include/linux/init_task.h               |  1 +
 include/linux/sched.h                   |  6 ++++
 include/linux/stop_machine.h            |  2 ++
 kernel/sched/core.c                     | 10 ++++--
 kernel/stop_machine.c                   | 25 +++++++++++---
 14 files changed, 212 insertions(+), 7 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2014-11-18 17:54 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).