Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp3737305imc; Sun, 24 Feb 2019 11:47:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IYfXSi1biQ0fPJgL9ki3QAIsrBkBKxRvXLa6d41EgOYLLrhBPp4VweAx9MpJhmmkrPEHLot X-Received: by 2002:a62:5e46:: with SMTP id s67mr610946pfb.126.1551037668317; Sun, 24 Feb 2019 11:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551037668; cv=none; d=google.com; s=arc-20160816; b=Sd7EH1/WphmZ6WQPKOL3HrUoiLFMcV/d1fUMcENdqauFYbdlw4IsbBQsROLL3dUjG1 5t1E6FJhGDHCroe/8HUQrUbXZjwsVmZesHEliI7XBxyk9JDuWPkCZOcWihSFGj5sBXfK W6405tmjPPDTkzn92VzECjq18CyiNvyqULA1k/Tc1MfrcqylhknYc9uOIWmjzP/sQdTq dHdkmKQp24+7zMQmHNFMLzmi7xAsTmPYjEvLJEC0XFgQe+BMV5+vFOdMvj5dN36oLlVP xsPmR/XlZS6bsXaO+ZDfkOgZZ/Zu1WmmgWIVqo70ty1YhG8raRsGN/zHlV9AjTHxhqoh NDRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=n26sDCJQ00M+m3PFkWudfhWasobbZA80hLdxFkMdxjA=; b=D2xJbkU0hGbp5zQbD85cW8ZUJ4UwT7rNx0OApIBHXG2tVse/vX2ze3Ef4QRkegdMDY tDtL7PGeGluh1YeUu37+E30KCpjIa1VGWzauJQb7FuRQMr770RUzXRcQxB2L1UJ0rjCv QT0zSso4IdgDKlm13ISgiewUsi1/Z6R4NDZxR+HnDjyTf26n1Dp5CSzq8xcbknJrtOD3 ivJ29/shGcND2edhbZr42EM4UqNsfP7h6gkiew5No5hBeLUj6wAqLHe3DT82sFkeAkp4 RlcSMFtGJyI1KKk4kBVYP/+9Z9u9oo0J/hkTCWID27XyqVxFndGefDBtzCxXadMnd+Gk 2VuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=alJZ0BEl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i186si7785192pfb.108.2019.02.24.11.47.32; Sun, 24 Feb 2019 11:47:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=alJZ0BEl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728131AbfBXTpu (ORCPT + 99 others); Sun, 24 Feb 2019 14:45:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:53156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727909AbfBXTpu (ORCPT ); Sun, 24 Feb 2019 14:45:50 -0500 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7414220989 for ; Sun, 24 Feb 2019 19:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551037548; bh=gkoetyKKtrcsSAwt0R49llWeAXh/gqNtg+z9C+/LStM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=alJZ0BEl5cBq1zj8Z2RwSgjChK2413fcq/GRXQbblvzgBGkpMP2NXsc2CGz9vwom0 /C2cDmQTIxW22KpBqKt1Z4xnMkEEvqhwnYfxtY1IrSp9ySJ0KXh+cyIziIkEotHAL3 OwoDnTu+5V0V181+/ZOVJzZQBLnxpcyixu+mB4oQ= Received: by mail-wm1-f47.google.com with SMTP id x7so6154048wmj.0 for ; Sun, 24 Feb 2019 11:45:48 -0800 (PST) X-Gm-Message-State: AHQUAuaGXv2MR2WtDV8A3PzcSOtaB0+jlozoQPP6NpLzyrW9d/ivM9cq XjuJF1NB5ZU8dErTqoRzECK5z/OdTGZNhOgmVea6zw== X-Received: by 2002:a1c:9ad3:: with SMTP id c202mr4032919wme.83.1551037546852; Sun, 24 Feb 2019 11:45:46 -0800 (PST) MIME-Version: 1.0 References: <1547673522-226408-1-git-send-email-fenghua.yu@intel.com> <1547673522-226408-6-git-send-email-fenghua.yu@intel.com> <20190221192424.GA158428@romley-ivt3.sc.intel.com> <3E5A0FA7E9CA944F9D5414FEC6C712209D877F3A@ORSMSX106.amr.corp.intel.com> In-Reply-To: <3E5A0FA7E9CA944F9D5414FEC6C712209D877F3A@ORSMSX106.amr.corp.intel.com> From: Andy Lutomirski Date: Sun, 24 Feb 2019 11:45:35 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/3] x86/cpufeatures: Enumerate user wait instructions To: "Yu, Fenghua" Cc: Andy Lutomirski , "Xu, Tao3" , "Liu, Jingqi" , Thomas Gleixner , Borislav Petkov , Ingo Molnar , H Peter Anvin , Andrew Cooper , "Raj, Ashok" , "Shankar, Ravi V" , linux-kernel , x86 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 21, 2019 at 2:57 PM Yu, Fenghua wrote: > > > From: Fenghua Yu [mailto:fenghua.yu@intel.com] > > On Wed, Feb 20, 2019 at 10:37:27PM -0800, Andy Lutomirski wrote: > > Or to simplify the situation, how about we still use zero as global max= wait > > time (i.e. no limitation for global wait time) as implemented in this p= atch > > set? User can still change the value to any value based on their usage.= Isn't > > this a right way to take care of any usage? > > Plus, if scheduler timers works, umwait will be forced time out by timer = in HZ anyway. Indeed. But, on some configs, the scheduler timer intentionally will *not* fire. > > Only for case without scheduler timer, sysadmin may need to set a small m= ax umwait time to force timout. But in this case (real time), I doubt user = app really wants to call umwait to save power with long latency of waking u= p from umwait. So likely in this case, user app won't call umwait and there= is no usage to set a small value for max umwait time. I don't really know why an application would use umwait at all. About the only legitimate use I can think of is to treat it as a somewhat power-saving variant of REP NOP. What I want to avoid is the case where it works dramatically differently on NO_HZ_FULL systems as compared to everything else. Also, UMWAIT may behave a bit differently if the max timeout is hit, and I'd like that path to get exercised widely by making it happen even on default configs. So I propose setting the timeout to either 100 microseconds or 100k "cycles" by default. In the event someone determines that they save materially more power or gets materially better performance with a longer timeout, we can revisit the value. --Andy