From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbbETIz3 (ORCPT ); Wed, 20 May 2015 04:55:29 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:32843 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbbETIzZ (ORCPT ); Wed, 20 May 2015 04:55:25 -0400 Date: Wed, 20 May 2015 10:55:20 +0200 From: Ingo Molnar To: Borislav Petkov Cc: Huang Rui , Len Brown , "Rafael J. Wysocki" , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, Fengguang Wu , Aaron Lu , Tony Li Subject: Re: [RFC PATCH 2/4] x86, mwaitt: introduce mwaitx idle with a configurable timer Message-ID: <20150520085520.GA8566@gmail.com> References: <1432022472-2224-1-git-send-email-ray.huang@amd.com> <1432022472-2224-3-git-send-email-ray.huang@amd.com> <20150519113121.GD4819@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150519113121.GD4819@pd.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Borislav Petkov wrote: > On Tue, May 19, 2015 at 04:01:10PM +0800, Huang Rui wrote: > > MWAITX/MWAIT does not let the cpu core go into C1 state on AMD processors. > > The cpu core still consumes less power while waiting, and has faster exit > > from waiting than "Halt". This patch implements an interface using the > > kernel parameter "idle=" to configure mwaitx type and timer value. > > > > If "idle=mwaitx", the timeout will be set as the maximum value > > ((2^64 - 1) * TSC cycle). > > If "idle=mwaitx,100", the timeout will be set as 100ns. > > If the processor doesn't support MWAITX, then halt is used. So what does the hardware do with the timeout value? Does it use it to decide how 'deep' a sleep it will go into, i.e. larger timeouts cause longer entry and exit latencies? Or some other purpose? I suppose it's also the case that if an interrupt arrives _before_ the expected timeout then MWAITX will try to exit immediately, it won't wait until the timeout, right? Thanks, Ingo