From patchwork Fri Oct 14 00:53:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 9375991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3958D607FD for ; Fri, 14 Oct 2016 01:05:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FFE92A16A for ; Fri, 14 Oct 2016 01:05:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F18222A0F7; Fri, 14 Oct 2016 01:05:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EEE42A0F7 for ; Fri, 14 Oct 2016 01:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757321AbcJNBFq (ORCPT ); Thu, 13 Oct 2016 21:05:46 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33447 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754009AbcJNBFo (ORCPT ); Thu, 13 Oct 2016 21:05:44 -0400 Received: by mail-pf0-f193.google.com with SMTP id i85so2647395pfa.0; Thu, 13 Oct 2016 18:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Al0MsXTFAr88iAbvX7cTpB7T5sTfPmqn7UocKidqxR8=; b=AOPYTCn+WdsaaXyLfBwQC27vgLbM8yO1pzcUXCdyAbBbZoinrzhELCGSuSn1WoAkgA 3uERmitF4qESxhZJhUvYWwfUjAHVIPAPcOdR6d1DoZ2v77nBjoFzn9X0tr/1PTWX/SWe ZG46pHBHcTvNhX1XN3EtN1nUoRZRhQ8nQdvQ+sxE0+MvS2Q/jL1bXW5o3fWdn+aHtRf1 xC6IYp3ILmzrBese5KAfBj8tUvwSWid9Bw+XUjSYjfy8oPJsPhqRJzU9IlL/UiK2b6fm tLnTVwPI7cmN1Pfw+XP2bTDrZi4NSehc296r41SColos+BvJlwets7IKTOoslEUTm+Vx jIig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Al0MsXTFAr88iAbvX7cTpB7T5sTfPmqn7UocKidqxR8=; b=OzYivBz4yDcOXqIlVvpTlIeSD6cha51qrTodgnT8e1Wb11UN5poRXffZ2o+I8/4c21 2TV3GoKEmXhoFJSSc/6Vuh4iR7LT3DO0B92PPZ+ORKw69Aqyo8QnxlI6u61gOWc/SEpu 4aoYh0LelB8WS6PQSipeNLaZwelLxjTQH73NnFiqRnqHr/kIB/VVQM45T8pqfm+XpqLu l5yAQ5pEt7AItE1v9hHN8YpxLftDNJVCX5nLEEAzhWJaU5460zdp8sRju8lpXpXeGXAI bzQ42g2M3+7froirOda6McH2oFb1VcGhGB+QoYCJbSGHUXDPGDCZOuLvUi3kbZudZl+M xgBA== X-Gm-Message-State: AA6/9Rm8bG4CNIsZxnXf9lDGBV3+U0On8VYeLmsxfqJIYqhIgmch6D+3K0gwcVhFpRyQnA== X-Received: by 10.98.223.145 with SMTP id d17mr14054128pfl.82.1476406424062; Thu, 13 Oct 2016 17:53:44 -0700 (PDT) Received: from dyn253.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id f2sm22285272pfj.68.2016.10.13.17.53.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 17:53:43 -0700 (PDT) From: Suraj Jitindar Singh To: pbonzini@redhat.com, rkrcmar@redhat.com, agraf@suse.com, corbet@lwn.net Cc: paulus@samba.org, mpe@ellerman.id.au, sam.bobroff@au1.ibm.com, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, benh@kernel.crashing.org, linux-doc@vger.kernel.org, Suraj Jitindar Singh Subject: [PATCH 1/6] kvm: export kvm module parameter variables Date: Fri, 14 Oct 2016 11:53:19 +1100 Message-Id: <1476406404-32752-2-git-send-email-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1476406404-32752-1-git-send-email-sjitindarsingh@gmail.com> References: <1476406404-32752-1-git-send-email-sjitindarsingh@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The kvm module has the parameters halt_poll_ns, halt_poll_ns_grow, and halt_poll_ns_shrink. Halt polling was recently added to the powerpc kvm-hv module and these parameters were essentially duplicated for that. There is no benefit to this duplication and it can lead to confusion when trying to tune halt polling. Thus move the definition of these variables to kvm_host.h and export them. This will allow the kvm-hv module to use the same module parameters by accessing these variables, which will be implemented in the next patch, meaning that they will no longer be duplicated. Signed-off-by: Suraj Jitindar Singh --- include/linux/kvm_host.h | 4 ++++ virt/kvm/kvm_main.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 01c0b9c..29b500a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1107,6 +1107,10 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) extern bool kvm_rebooting; +extern unsigned int halt_poll_ns; +extern unsigned int halt_poll_ns_grow; +extern unsigned int halt_poll_ns_shrink; + struct kvm_device { struct kvm_device_ops *ops; struct kvm *kvm; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 81dfc73..675d7b5 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -70,16 +70,19 @@ MODULE_AUTHOR("Qumranet"); MODULE_LICENSE("GPL"); /* Architectures should define their poll value according to the halt latency */ -static unsigned int halt_poll_ns = KVM_HALT_POLL_NS_DEFAULT; +unsigned int halt_poll_ns = KVM_HALT_POLL_NS_DEFAULT; module_param(halt_poll_ns, uint, S_IRUGO | S_IWUSR); +EXPORT_SYMBOL_GPL(halt_poll_ns); /* Default doubles per-vcpu halt_poll_ns. */ -static unsigned int halt_poll_ns_grow = 2; +unsigned int halt_poll_ns_grow = 2; module_param(halt_poll_ns_grow, uint, S_IRUGO | S_IWUSR); +EXPORT_SYMBOL_GPL(halt_poll_ns_grow); /* Default resets per-vcpu halt_poll_ns . */ -static unsigned int halt_poll_ns_shrink; +unsigned int halt_poll_ns_shrink; module_param(halt_poll_ns_shrink, uint, S_IRUGO | S_IWUSR); +EXPORT_SYMBOL_GPL(halt_poll_ns_shrink); /* * Ordering of locks: