From owner-svn-doc-head@freebsd.org Tue Jul 14 15:08:59 2015 Return-Path: Delivered-To: svn-doc-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0897B9A16BC; Tue, 14 Jul 2015 15:08:59 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECC8BAB7; Tue, 14 Jul 2015 15:08:58 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6EF8w22052757; Tue, 14 Jul 2015 15:08:58 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6EF8wpw052756; Tue, 14 Jul 2015 15:08:58 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201507141508.t6EF8wpw052756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Tue, 14 Jul 2015 15:08:58 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r46969 - head/en_US.ISO8859-1/htdocs/news/status X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2015 15:08:59 -0000 Author: wblock Date: Tue Jul 14 15:08:58 2015 New Revision: 46969 URL: https://svnweb.freebsd.org/changeset/doc/46969 Log: Add Konstantin Belousov 's Cx state report. Modified: head/en_US.ISO8859-1/htdocs/news/status/report-2015-04-2015-06.xml Modified: head/en_US.ISO8859-1/htdocs/news/status/report-2015-04-2015-06.xml ============================================================================== --- head/en_US.ISO8859-1/htdocs/news/status/report-2015-04-2015-06.xml Tue Jul 14 14:20:28 2015 (r46968) +++ head/en_US.ISO8859-1/htdocs/news/status/report-2015-04-2015-06.xml Tue Jul 14 15:08:58 2015 (r46969) @@ -971,4 +971,86 @@ + + + Sleep States Enhancements on <tt>x86</tt> + + + + + Konstantin + Belousov + + kib@FreeBSD.org + + + + + + + + +

The ACPI specication defines CPU Cx states, which are idle + states. Methods to enter the state and miscellaneous + information like state leave latency are returned by the _CST + ACPI method. To save energy and reduce useless heating, the + operating system enters the Cx state when the CPU has no work + to do. C0 is the non-idle state, while C1, C2, and C3 + (defined by ACPI) each represent an idle state with + sequentially more energy saving, but also with higher latency + of leave and possibly greater secondary costs. For example, + C1 is entered by executing the HLT instruction and has no + architecturally visible side effects, while entering C3 drops + the CPU cache and usually requires special chipset programming + to correctly handle requests from I/O devices to the CPU. Do + not confuse Cx, Px and Sx: Cx states are only meaningful when + the system is in fully operational state S0; Px states are + only meaningful when the system is not in the idle state, + C0.

+ +

Modern Intel CPUs enter Cx (x >= 1) states with the + dedicated instruction MWAIT, which enters a specified + low-power state until a specific write is observed by the CPU + bus logic. There is a complimentary MONITOR instruction to + set the monitored bus address. The legacy port I/O method of + entering Cx state is emulated by CPU microcode, which + intercepts the port I/O and executes MWAIT internally. Using + MWAIT as the method of entering Cx requires following + processor-specific procedures, which are communicated to the + operating system by the vendor-specific extensions in _CST. + The operating system must indicate readiness to support MWAIT + when calling _CST. Claimed benefits of using MWAIT are reduced + latencies of leaving the idle state, and visibility of more + deep states than defined by the common ACPI specification. + Still, modern Intel platforms report deep states as C2 to + avoid the not needed bus-mastering avoidance.

+ +

The new code asks ACPI for the Intel vendor-specific _CST + extensions, parses them, and uses MWAIT Cx entrance methods + when available. The change was committed as r282678 to + HEAD.

+ +

For Linux, Intel provides a driver which does not depend on + the ACPI tables to use MWAIT for entering Cx states. For all + Intel CPUs after Core2, the driver contains the description of + the Cx mode latencies and quirks, eliminating dependency on + the correct BIOS information, which is often incorrect. The + approach of porting the Linux driver was considered by several + people, but all evaluators independently concluded that the + project cannot maintain such an approach without direct + involvement from Intel.

+ +

During the work, around 500 lines of identical code between + the i386 and amd64 version of the idle handling were moved to + the common location x86/x86/cpu_machdep.c. Now the + i386 and amd64 machdep.c files contain only unique + machine-dependent routines. This advance depended on John + Baldwin's elimination of the unmaintained Xen PVM i386 + port.

+ + + + The FreeBSD Foundation + +