All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "Wei, Gang" <gang.wei@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>,
	"Yu, Ke" <ke.yu@intel.com>
Subject: Re: [PATCH]ACPI: re-enable mwait for xen cpuidle
Date: Mon, 05 Apr 2010 11:30:53 -0700	[thread overview]
Message-ID: <4BBA2C5D.3060204@goop.org> (raw)
In-Reply-To: <E6467867A6B05E4FA831B7DF29925F5C40E67AC0@shzsmsx502.ccr.corp.intel.com>

On 04/03/2010 07:07 AM, Wei, Gang wrote:
> On Saturday, 2010-4-3 2:33 AM, Jeremy Fitzhardinge wrote:
>    
>> On 04/02/2010 09:27 AM, Wei, Gang wrote:
>>      
>>> Updated the 2nd patch, only set MWAIT feature for dom0.
>>>
>>> Jimmy
>>>
>>> ACPI: re-enable mwait for xen cpuidle
>>>
>>> Xen hypervisor doesn't export mwait feature to dom0, but latest
>>> Linux kernel start to check this feature while initializing _PDC
>>> object. Modify xen_cpuid to re-enable mwait for xen cpuidle.
>>>
>>>        
>> What if the CPU really doesn't have MWAIT?
>>      
> If the CPU really doesn't have MWAIT, BIOS should know it and BIOS acpi code should not give C state table with MWAIT entry method. Even the BIOS give the wrong MWAIT C state info, xen cpuidle will refuse it and mark that C state as invalid.
>
>    
>> But I agree with your original assessment that setting MWAIT just to
>> get a couple of paths in ACPI parsing enabled is probably overkill,
>> but I don't like the idea of putting xen-specific tests into the acpi
>> code.
>>      
> I don't like it too. But some time we have to accept a workaround temporarily even we don't like it, until we find a graceful solution.
>
>    
>> Would it be possible to change the parser code to parse
>> unconditionally and then ignore the MWAIT-specific stuff later on?
>> (I haven't looked at the structure of the code, so I'm not sure if
>> this suggestion even makes sense.)
>>      
> That means to turn back to old change set. In 2.6.18, this check doesn't exist in the parser code path. I have to say, these checks made Linux kernel itself more robust. I am not sure whether we can find a better way which is also compatible with Xen's need.
>    

I had a closer look at the code, and I don't really understand it:

			if (acpi_processor_ffh_cstate_probe
					(pr->id,&cx, reg) == 0) {
				cx.entry_method = ACPI_CSTATE_FFH;
[1]			} else if (cx.type == ACPI_STATE_C1) {
				/*
				 * C1 is a special case where FIXED_HARDWARE
				 * can be handled in non-MWAIT way as well.
				 * In that case, save this _CST entry info.
				 * Otherwise, ignore this info and continue.
				 */
[2]				cx.entry_method = ACPI_CSTATE_HALT;
[3]				snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI HLT");
			} else {
				continue;
			}
[4]			if (cx.type == ACPI_STATE_C1&&
					(idle_halt || idle_nomwait)) {
				/*
				 * In most cases the C1 space_id obtained from
				 * _CST object is FIXED_HARDWARE access mode.
				 * But when the option of idle=halt is added,
				 * the entry_method type should be changed from
				 * CSTATE_FFH to CSTATE_HALT.
				 * When the option of idle=nomwait is added,
				 * the C1 entry_method type should be
				 * CSTATE_HALT.
				 */
[5]				cx.entry_method = ACPI_CSTATE_HALT;
[6]				snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI HLT");
			}


What's the if() at [1] doing?  If it succeeds, then it does [2,3] then 
falls into [4], which does the same test as [1] but also checks for 
idle_halt || idle_nomwait and then performs [5,6] which looks identical 
to [2,3].  It all seems a bit excessively convoluted, so I'm not quite 
sure how your patch interacts with this.

     J

  reply	other threads:[~2010-04-05 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  2:38 [PATCH]ACPI: re-enable mwait for xen cpuidle Wei, Gang
2010-04-02  5:40 ` Jeremy Fitzhardinge
2010-04-02  6:32   ` Wei, Gang
2010-04-02  9:34     ` Wei, Gang
2010-04-02 13:41       ` Wei, Gang
2010-04-02 14:27         ` Keir Fraser
2010-04-02 14:46           ` Keir Fraser
2010-04-02 15:18             ` Wei, Gang
2010-04-02 16:27       ` Wei, Gang
2010-04-02 18:33         ` Jeremy Fitzhardinge
2010-04-03 14:07           ` Wei, Gang
2010-04-05 18:30             ` Jeremy Fitzhardinge [this message]
2010-04-06  1:46               ` Wei, Gang

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=4BBA2C5D.3060204@goop.org \
    --to=jeremy@goop.org \
    --cc=gang.wei@intel.com \
    --cc=ke.yu@intel.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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 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.