From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5EEFC282DA for ; Wed, 17 Apr 2019 15:22:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 910F920821 for ; Wed, 17 Apr 2019 15:22:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732570AbfDQPWL (ORCPT ); Wed, 17 Apr 2019 11:22:11 -0400 Received: from mga07.intel.com ([134.134.136.100]:48338 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732007AbfDQPWL (ORCPT ); Wed, 17 Apr 2019 11:22:11 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2019 08:22:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,362,1549958400"; d="scan'208";a="132181430" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.181]) by orsmga007.jf.intel.com with ESMTP; 17 Apr 2019 08:22:03 -0700 Date: Wed, 17 Apr 2019 08:22:03 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, Liran Alon , Wanpeng Li Subject: Re: [PATCH v3 4/9] KVM: lapic: Allow user to disable auto-tuning of timer advancement Message-ID: <20190417152203.GC8567@linux.intel.com> References: <20190416203248.29429-1-sean.j.christopherson@intel.com> <20190416203248.29429-5-sean.j.christopherson@intel.com> <771a1410-e290-b017-1c54-3abbe069d4a2@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <771a1410-e290-b017-1c54-3abbe069d4a2@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Apr 17, 2019 at 02:59:43PM +0200, Paolo Bonzini wrote: > On 16/04/19 22:32, Sean Christopherson wrote: > > +static bool __read_mostly lapic_timer_advance_autotune = true; > > +module_param(lapic_timer_advance_autotune, bool, S_IRUGO | S_IWUSR); > > + > > Could we just have lapic_timer_advance_ns = 0 mean "adaptive tuning, > starting from a default of 1000" and anything else mean "no tuning, just > use this value"? Originally I implemented a variation of that, except I disabled autotuning if lapic_timer_advance_ns was set to anything other than the default. Liran requested a separate param since the behavior was admittedly a bit sneaky, and I didn't have a strong opinion either way, so here we are. I think 'lapic_timer_advance_ns = 0' should be used to disable the advancement. What if we make the param a signed int and have '-1' select the "adaptive tuning ..." option? That could also be the default. It saves a param and is hopefully more intuitive than what I originally proposed.