Re: CPU C-state storange on Panasonic TOUGH BOOK CF-R9

From: Andriy Gapon <avg_at_icyb.net.ua>
Date: Sun, 12 Sep 2010 13:31:29 +0300
on 12/09/2010 13:25 Norikatsu Shigemura said the following:
> Hi avg.
> 
> On Sun, 12 Sep 2010 19:09:52 +0900
> Norikatsu Shigemura <nork_at_FreeBSD.org> wrote:
>> 	Logic is mistake.  I'll re-make a patch and retry.
> 
> 	I re-tried following patch:
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> --- sys/dev/acpica/acpi_cpu.c.orig	2010-09-12 01:31:38.144243000 +0900
> +++ sys/dev/acpica/acpi_cpu.c	2010-09-12 19:11:00.906223222 +0900
> _at__at_ -690,19 +690,11 _at__at_
>  	    sc->cpu_cx_count++;
>  	    continue;
>  	case ACPI_STATE_C2:
> -	    if (cx_ptr->trans_lat > 100) {
> -		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> -				 "acpi_cpu%d: C2[%d] not available.\n",
> -				 device_get_unit(sc->cpu_dev), i));
> -		continue;
> -	    }
>  	    sc->cpu_non_c3 = i;
>  	    break;
>  	case ACPI_STATE_C3:
>  	default:
> -	    if (cx_ptr->trans_lat > 1000 ||
> -		(cpu_quirks & CPU_QUIRK_NO_C3) != 0) {
> -
> +	    if (cpu_quirks & CPU_QUIRK_NO_C3) {
>  		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>  				 "acpi_cpu%d: C3[%d] not available.\n",
>  				 device_get_unit(sc->cpu_dev), i));

The above looks good.

> _at__at_ -731,6 +723,9 _at__at_
>  	    cx_ptr++;
>  	    sc->cpu_cx_count++;
>  	}
> +else {
> +device_printf(sc->cpu_dev, "DEBUG: cx_ptr->p_lvlx IS NULL.\n");
> +}
>      }
>      AcpiOsFree(buf.Pointer);

What's this?  The indentation is messed up too :-)

> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 
> 	Test is OK:
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # sysctl hw.acpi.cpu.cx_lowest=C2 && sleep 10 && sysctl dev.cpu.0.cx_usage dev.cpu.1.cx_usage dev.cpu.2.cx_usage dev.cpu.3.cx_usage
> hw.acpi.cpu.cx_lowest: C3 -> C2
> dev.cpu.0.cx_usage: 2.37% 97.62% last 3028us
> dev.cpu.1.cx_usage: 0.87% 99.12% last 4379us
> dev.cpu.2.cx_usage: 0.54% 99.45% last 14314us
> dev.cpu.3.cx_usage: 1.36% 98.63% last 16982us
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 
> 	But I don't know how I couldn't get C3:-(.
> 	Not reachable my DEBUG code.
> 
> 	Thank you.

acpi_lid0: Lid closed
em0: Link is up 1000 Mbps Full Duplex
PROCESSOR-0722 [402244] cpu_cx_cst            : acpi_cpu0: Got C2 - 245 latency
PROCESSOR-0722 [403097] cpu_cx_cst            : acpi_cpu1: Got C2 - 245 latency
PROCESSOR-0722 [403855] cpu_cx_cst            : acpi_cpu2: Got C2 - 245 latency
PROCESSOR-0722 [405022] cpu_cx_cst            : acpi_cpu3: Got C2 - 245 latency

Maybe because of this?
It seems like you do something and ACPI disables C3, leaving only C2/

-- 
Andriy Gapon
Received on Sun Sep 12 2010 - 08:31:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:07 UTC