From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932223AbbFLIC2 (ORCPT ); Fri, 12 Jun 2015 04:02:28 -0400 Received: from mail-bl2on0140.outbound.protection.outlook.com ([65.55.169.140]:15648 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755165AbbFLICS (ORCPT ); Fri, 12 Jun 2015 04:02:18 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; amacapital.net; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NPTNNP-07-YHU-02 X-M-MSG: Date: Fri, 12 Jun 2015 15:50:33 +0800 From: Huang Rui To: Peter Zijlstra CC: Andy Lutomirski , Borislav Petkov , Thomas Gleixner , "Rafael J. Wysocki" , Len Brown , John Stultz , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , "linux-kernel@vger.kernel.org" , X86 ML , Fengguang Wu , Aaron Lu , Suravee Suthikulanit , Tony Li , Ken Xue Subject: Re: [PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer Message-ID: <20150612075033.GA24767@hr-slim.amd.com> References: <1434032051-1953-1-git-send-email-ray.huang@amd.com> <1434032051-1953-3-git-send-email-ray.huang@amd.com> <20150612040322.GB21621@hr-slim.amd.com> <20150612073848.GQ3644@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150612073848.GQ3644@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD019;1:pAUjhsJ9BUAiBuyO6e/GM3cYED28nIRe9V/w5vFU+nDvVrGlVDxp/WzMnFJhOvi8Z9HZ9Y1MDjp6e+M4/aNKDulm63dAcRM3SimQIgyikaBKwcm22WFk1D01uyi6Y/4ItMJXq25FCL8Vn/mp3x4Hfy8hXI0ZEndwdKV42zP0wn6geqHilJ2kKDnBuUaWYbEeCV62XVeor/VpmCqYcrs4gZ21nxiQs0MByi02GHeIpsfFkyZAocq5jUZ5YnC0WYz/pNEtvxpWmhWyTIDBTMnNhLkq3JkHVfb277F8uvWTF0TW67rcMjNQO0EWJ546BYLMJggYv6ZQj5fGYXZhCGWESy2SMY8OjQOEGytDwR/tEiA= X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(24454002)(199003)(189002)(164054003)(51704005)(83506001)(93886004)(46102003)(33656002)(5003600100002)(62966003)(77156002)(105586002)(189998001)(92566002)(53416004)(106466001)(76176999)(54356999)(50986999)(50466002)(46406003)(77096005)(4001350100001)(2950100001)(110136002)(101416001)(86362001)(97756001)(47776003)(87936001)(23726002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR02MB1116;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1116;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1193; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BY1PR02MB1116;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1116; X-Forefront-PRVS: 060503E79B X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2015 08:02:14.0822 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1116 X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 12, 2015 at 09:38:48AM +0200, Peter Zijlstra wrote: > On Fri, Jun 12, 2015 at 12:03:22PM +0800, Huang Rui wrote: > > > > What's the purpose of the "enable" parameter? > > > > > > > Enable mwaitx timer. Should I add comments to explain the usage? > > No, you should read your own patch, notice that the only usage site > provides a true, then realize its a redundant bit of code and kill it > dead. Yeah, but I remembered at last time, someone tell me we shouldn't force to set timer always enabled. So I add this interface to expose more clearly. :) So could I use __mwaitx directly like below: __monitorx(&dummy, 0, 0); __mwaitx(0xf, delay, MWAITX_ECX_TIMER_ENABLE); Thanks, Rui