From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753656AbdKNHoY (ORCPT ); Tue, 14 Nov 2017 02:44:24 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:55329 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753494AbdKNHoP (ORCPT ); Tue, 14 Nov 2017 02:44:15 -0500 X-Google-Smtp-Source: AGs4zMZacRZALmbuEzwm1Tkbo2BCALZew2HxXJALn/R/30RCUzv70+o9YKXfwvwZurLF2hCwxaN9rw== Date: Tue, 14 Nov 2017 08:44:10 +0100 From: Ingo Molnar To: Quan Xu Cc: Quan Xu , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, x86@kernel.org, Yang Zhang Subject: Re: [PATCH RFC v3 4/6] Documentation: Add three sysctls for smart idle poll Message-ID: <20171114074410.c5h5zg43xtcmelez@gmail.com> References: <1510570064-6178-1-git-send-email-quan.xu0@gmail.com> <20171113150842.epdffyxhlu5nq37u@gmail.com> <35da8c93-95fb-8bf0-8538-4e1ef5f126f4@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35da8c93-95fb-8bf0-8538-4e1ef5f126f4@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Quan Xu wrote: > > > On 2017/11/13 23:08, Ingo Molnar wrote: > > * Quan Xu wrote: > > > > > From: Quan Xu > > > > > > To reduce the cost of poll, we introduce three sysctl to control the > > > poll time when running as a virtual machine with paravirt. > > > > > > Signed-off-by: Yang Zhang > > > Signed-off-by: Quan Xu > > > --- > > > Documentation/sysctl/kernel.txt | 35 +++++++++++++++++++++++++++++++++++ > > > arch/x86/kernel/paravirt.c | 4 ++++ > > > include/linux/kernel.h | 6 ++++++ > > > kernel/sysctl.c | 34 ++++++++++++++++++++++++++++++++++ > > > 4 files changed, 79 insertions(+), 0 deletions(-) > > > > > > diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt > > > index 694968c..30c25fb 100644 > > > --- a/Documentation/sysctl/kernel.txt > > > +++ b/Documentation/sysctl/kernel.txt > > > @@ -714,6 +714,41 @@ kernel tries to allocate a number starting from this one. > > > ============================================================== > > > +paravirt_poll_grow: (X86 only) > > > + > > > +Multiplied value to increase the poll time. This is expected to take > > > +effect only when running as a virtual machine with CONFIG_PARAVIRT > > > +enabled. This can't bring any benifit on bare mental even with > > > +CONFIG_PARAVIRT enabled. > > > + > > > +By default this value is 2. Possible values to set are in range {2..16}. > > > + > > > +============================================================== > > > + > > > +paravirt_poll_shrink: (X86 only) > > > + > > > +Divided value to reduce the poll time. This is expected to take effect > > > +only when running as a virtual machine with CONFIG_PARAVIRT enabled. > > > +This can't bring any benifit on bare mental even with CONFIG_PARAVIRT > > > +enabled. > > > + > > > +By default this value is 2. Possible values to set are in range {2..16}. > > > + > > > +============================================================== > > > + > > > +paravirt_poll_threshold_ns: (X86 only) > > > + > > > +Controls the maximum poll time before entering real idle path. This is > > > +expected to take effect only when running as a virtual machine with > > > +CONFIG_PARAVIRT enabled. This can't bring any benifit on bare mental > > > +even with CONFIG_PARAVIRT enabled. > > > + > > > +By default, this value is 0 means not to poll. Possible values to set > > > +are in range {0..500000}. Change the value to non-zero if running > > > +latency-bound workloads in a virtual machine. > > I absolutely hate it how this hybrid idle loop polling mechanism is not > > self-tuning! > > Ingo, actually it is self-tuning.. Then why the hell does it touch the syscall ABI? > could I only leave paravirt_poll_threshold_ns parameter (the maximum poll time), > which is as similar as "adaptive halt-polling" Wanpeng mentioned.. then user can > turn it off, or find an appropriate threshold for some odd scenario.. That way lies utter madness. Maybe add it as a debugfs knob, but exposing it to userspace: NAK. Thanks, Ingo