All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] fix stolen time for SMT without LPAR
Date: Fri, 25 May 2007 15:08:31 +1000	[thread overview]
Message-ID: <16370.1180069711@neuling.org> (raw)
In-Reply-To: <12635.1180013602@neuling.org>

For POWERPC, stolen time accounts for cycles lost to the hypervisor or
PURR cycles attributed to the other SMT thread.  Hence, when a PURR is
available, we should still calculate stolen time, irrespective of being
virtualised.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
Updated to fix link error when CONFIG_PPC_SPLPAR is off.  

 arch/powerpc/kernel/time.c |    8 +++++---
 include/asm-powerpc/time.h |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/time.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/time.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/time.c
@@ -214,7 +214,6 @@ static void account_process_time(struct 
  	run_posix_cpu_timers(current);
 }
 
-#ifdef CONFIG_PPC_SPLPAR
 /*
  * Stuff for accounting stolen time.
  */
@@ -244,7 +243,8 @@ void snapshot_timebases(void)
 {
 	int cpu;
 
-	if (!cpu_has_feature(CPU_FTR_PURR))
+	if (!cpu_has_feature(CPU_FTR_PURR) &&
+	    !firmware_has_feature(FW_FEATURE_SPLPAR))
 		return;
 	for_each_possible_cpu(cpu)
 		spin_lock_init(&per_cpu(cpu_purr_data, cpu).lock);
@@ -257,7 +257,8 @@ void calculate_steal_time(void)
 	s64 stolen;
 	struct cpu_purr_data *pme;
 
-	if (!cpu_has_feature(CPU_FTR_PURR))
+	if (!cpu_has_feature(CPU_FTR_PURR) &&
+	    !firmware_has_feature(FW_FEATURE_SPLPAR))
 		return;
 	pme = &per_cpu(cpu_purr_data, smp_processor_id());
 	if (!pme->initialized)
@@ -273,6 +274,7 @@ void calculate_steal_time(void)
 	spin_unlock(&pme->lock);
 }
 
+#ifdef CONFIG_PPC_SPLPAR
 /*
  * Must be called before the cpu is added to the online map when
  * a cpu is being brought up at runtime.
Index: linux-2.6-ozlabs/include/asm-powerpc/time.h
===================================================================
--- linux-2.6-ozlabs.orig/include/asm-powerpc/time.h
+++ linux-2.6-ozlabs/include/asm-powerpc/time.h
@@ -232,7 +232,7 @@ extern void account_process_vtime(struct
 #define account_process_vtime(tsk)		do { } while (0)
 #endif
 
-#if defined(CONFIG_VIRT_CPU_ACCOUNTING) && defined(CONFIG_PPC_SPLPAR)
+#if defined(CONFIG_VIRT_CPU_ACCOUNTING)
 extern void calculate_steal_time(void);
 extern void snapshot_timebases(void);
 #else

  reply	other threads:[~2007-05-25  5:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 13:33 [PATCH] fix stolen time for SMT without LPAR Michael Neuling
2007-05-25  5:08 ` Michael Neuling [this message]
2007-06-07  1:33   ` Paul Mackerras
2007-06-08  3:18     ` Michael Neuling

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=16370.1180069711@neuling.org \
    --to=mikey@neuling.org \
    --cc=linuxppc-dev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.