mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Cc: "mingo@elte.hu" <mingo@elte.hu>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"svaidy@linux.vnet.ibm.com" <svaidy@linux.vnet.ibm.com>,
	"a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>
Subject: Re: [patch 2/2] x86: put offline CPUs into deepest mwait cstate_subcstate
Date: Mon, 25 May 2009 08:56:46 +0800	[thread overview]
Message-ID: <20090525005646.GA9093@sli10-desk.sh.intel.com> (raw)
In-Reply-To: <20090522232230.162239000@intel.com>

On Sat, May 23, 2009 at 07:19:42AM +0800, Pallipadi, Venkatesh wrote:
> Offline CPUs can save power by going into deepest cstate, subcstate
> instead of hlt loop.
> 
> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> ---
>  arch/x86/kernel/acpi/cstate.c |   51 +++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 51 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
> index bbbe4bb..5b0988a 100644
> --- a/arch/x86/kernel/acpi/cstate.c
> +++ b/arch/x86/kernel/acpi/cstate.c
> @@ -150,6 +150,54 @@ void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx)
>  }
>  EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_enter);
>  
> +static unsigned long mwait_play_dead_eax;
> +
> +static void mwait_play_dead(void)
> +{
> +	if (boot_cpu_data.x86 >= 4)
> +		wbinvd();
> +
> +	while (1) {
> +		__monitor((void *)&current_thread_info()->flags, 0, 0);
> +		smp_mb();
> +		__mwait(mwait_play_dead_eax, 0);
> +	}
> +}
CPU is dead, can current_thread_info() still be used? Maybe just monitor a never changed
address.

Looks the patch will always take the highest native C-state, is this safe, considering
BIOS usually limit C-state?

Thanks,
Shaohua

  reply	other threads:[~2009-05-25  0:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-22 23:19 [patch 0/2] x86: Make offline cpus to go to deepest idle state using mwait venkatesh.pallipadi
2009-05-22 23:19 ` [patch 1/2] x86: Add pm_play_dead funcptr to power-efficiently offline CPUs venkatesh.pallipadi
2009-05-23 10:44   ` Peter Zijlstra
2009-05-23 15:07     ` Pallipadi, Venkatesh
2009-06-22 17:25     ` Pallipadi, Venkatesh
2009-05-22 23:19 ` [patch 2/2] x86: put offline CPUs into deepest mwait cstate_subcstate venkatesh.pallipadi
2009-05-25  0:56   ` Shaohua Li [this message]
2009-05-26 21:17     ` Pallipadi, Venkatesh
2010-09-17 23:46   ` [tip:x86/idle] x86, hotplug: Use mwait to offline a processor, fix the legacy case tip-bot for H. Peter Anvin
2010-09-18  0:13     ` [tip:x86/idle] x86, hotplug: Move WBINVD back outside the play_dead loop tip-bot for H. Peter Anvin
2010-09-18  0:48       ` Venkatesh Pallipadi
2010-09-20 18:20         ` H. Peter Anvin
2010-09-20 20:11           ` H. Peter Anvin
2010-09-20 22:34             ` Venkatesh Pallipadi

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=20090525005646.GA9093@sli10-desk.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=svaidy@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=venkatesh.pallipadi@intel.com \
    /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

all inboxes | Powered by JetHome®