From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753631AbbETOv3 (ORCPT ); Wed, 20 May 2015 10:51:29 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:34967 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbbETOv1 (ORCPT ); Wed, 20 May 2015 10:51:27 -0400 Date: Wed, 20 May 2015 16:51:22 +0200 From: Ingo Molnar To: Thomas Gleixner Cc: Borislav Petkov , Huang Rui , Len Brown , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org, Fengguang Wu , Aaron Lu , Tony Li , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker Subject: Re: [RFC PATCH 2/4] x86, mwaitt: introduce mwaitx idle with a configurable timer Message-ID: <20150520145122.GB10374@gmail.com> References: <1432022472-2224-3-git-send-email-ray.huang@amd.com> <20150519113121.GD4819@pd.tnic> <20150520085520.GA8566@gmail.com> <20150520091213.GA3645@pd.tnic> <20150520102258.GA21245@gmail.com> <20150520105032.GD3645@pd.tnic> <20150520111120.GA25215@gmail.com> <20150520112110.GG3645@pd.tnic> <20150520114125.GA31212@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 * Thomas Gleixner wrote: > On Wed, 20 May 2015, Ingo Molnar wrote: > > * Borislav Petkov wrote: > > > > > On Wed, May 20, 2015 at 01:11:20PM +0200, Ingo Molnar wrote: > > > > - MWAITX takes a 'timeout' parameter, but otherwise behaves exactly > > > > like MWAIT: i.e. once idle it won't exit idle on its own > > > > > > Let me quote the commit message: > > > > > > "MWAITT, another name is MWAITX (MWAIT with extensions), has a > > > configurable timer that causes MWAITX to exit on expiration." > > > > Ah. A useful skill that is, being able to read. > > > > > You need to set the second bit in ECX to enable the timer. > > > > > > I guess if you don't, then you get normal MWAIT but then you don't > > > need the timeout either... > > > > Yeah. > > > > So if it's a true timeout then we could use it to implement > > irq-less timers: that's actually pretty useful, because it could > > be faster than getting a local APIC timer irq, etc. > > Uurgh, NO NO NO! I know, I know :-) The XP PIC was a nasty, broken hardware timer, and all x86 timer generations after that made the situation even worse. > We have enough trouble with non functional timers already, we do not > need another variant of those. > > We can supply the estimated sleep time though if that helps the PM > controller underneath to select a state. That's more or less what we > do in the governors as well. That's not what appears to be happening here though: the MWAITX will return after the timeout. Which isn't really useful unless we use it to drive timers. So 'lets not use it' might be the sane answer. Thanks, Ingo