From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: kernelfans@gmail.com
Cc: Paul Mackerras <paulus@samba.org>,
linuxppc-dev@lists.ozlabs.org, Alexander Graf <agraf@suse.de>,
kvm-ppc@vger.kernel.org
Subject: Re: [RFC 03/11] powerpc: kvm: add interface to control kvm function on a core
Date: Wed, 12 Nov 2014 18:31:35 +0530 [thread overview]
Message-ID: <20141112130134.GC16566@linux.vnet.ibm.com> (raw)
In-Reply-To: <1413487800-7162-4-git-send-email-kernelfans@gmail.com>
* kernelfans@gmail.com <kernelfans@gmail.com> [2014-10-16 15:29:52]:
> When kvm is enabled on a core, we migrate all external irq to primary
> thread. Since currently, the kvmirq logic is handled by the primary
> hwthread.
>
> Todo: this patch lacks re-enable of irqbalance when kvm is disable on
> the core
>
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/sysfs.c | 39 ++++++++++++++++++++++++++++++++++
> arch/powerpc/sysdev/xics/xics-common.c | 12 +++++++++++
> 2 files changed, 51 insertions(+)
>
> diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
> index 67fd2fd..a2595dd 100644
> --- a/arch/powerpc/kernel/sysfs.c
> +++ b/arch/powerpc/kernel/sysfs.c
> @@ -552,6 +552,45 @@ static void sysfs_create_dscr_default(void)
> if (cpu_has_feature(CPU_FTR_DSCR))
> err = device_create_file(cpu_subsys.dev_root, &dev_attr_dscr_default);
> }
> +
> +#ifdef CONFIG_KVMPPC_ENABLE_SECONDARY
> +#define NR_CORES (CONFIG_NR_CPUS/threads_per_core)
> +static DECLARE_BITMAP(kvm_on_core, NR_CORES) __read_mostly
> +
> +static ssize_t show_kvm_enable(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> +}
> +
> +static ssize_t __used store_kvm_enable(struct device *dev,
> + struct device_attribute *attr, const char *buf,
> + size_t count)
> +{
> + struct cpumask stop_cpus;
> + unsigned long core, thr;
> +
> + sscanf(buf, "%lx", &core);
> + if (core > NR_CORES)
> + return -1;
> + if (!test_bit(core, &kvm_on_core))
> + for (thr = 1; thr< threads_per_core; thr++)
> + if (cpu_online(thr * threads_per_core + thr))
> + cpumask_set_cpu(thr * threads_per_core + thr, &stop_cpus);
Shouldnt this be
if (cpu_online(core * threads_per_core + thr))
cpumask_set_cpu(core * threads_per_core + thr, &stop_cpus);
?
--
Thanks and Regards
Srikar Dronamraju
next prev parent reply other threads:[~2014-11-12 13:01 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 [this message]
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
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=20141112130134.GC16566@linux.vnet.ibm.com \
--to=srikar@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).