From patchwork Tue Oct 10 07:11:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9995151 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 83E1A603B5 for ; Tue, 10 Oct 2017 07:11:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7586627F98 for ; Tue, 10 Oct 2017 07:11:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69FA827FA3; Tue, 10 Oct 2017 07:11:22 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 0450427F98 for ; Tue, 10 Oct 2017 07:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754318AbdJJHLV (ORCPT ); Tue, 10 Oct 2017 03:11:21 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36848 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbdJJHLU (ORCPT ); Tue, 10 Oct 2017 03:11:20 -0400 Received: by mail-pf0-f193.google.com with SMTP id z11so16099219pfk.3; Tue, 10 Oct 2017 00:11:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=uOkEJi9hwSne59o5LZlk4zBTVjkP1mg2Mav9fCuYSPg=; b=TqLABO6FB8wYh7gz/GOqbMlkmt6z2e/XUxKr2qy74QLtR081Ow0K8XogrVIB+GhdRM /RiUn7w5rqUajaoO1A0eNoXrz8lXN9295AnGC98znDeTEYvwgrV4QRzBODCb0vv1GJ7A 3LPyKEX0mm1VbpxfeR0oFmukd/stjL0Zf2KSu/zcSGBqYxiPDNve15pQHhniWVTmpJAp RrN85eK3IdFUaUOrNpufzU/7qGPCYhlh+0j347FjcvhqpsteBeECsGXWPRMCTqdIEdgA fsDmQLEY41VX+snMQZ8n7W1OY4b0fPTTOv5ftHmNq/MbVvwqjl8v1QYvMtW7ncfCK3ZX 6t6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uOkEJi9hwSne59o5LZlk4zBTVjkP1mg2Mav9fCuYSPg=; b=aIgvURD6+y7Hf5hOlSHJlKsrXT4Isxyh7JGjc7tKe0AUw3VbGdlxbgFMweeArE0iep sezT8QivmNALp+FV6J2V3YJJwbtH5mfPxJ5GjAukYdBYVolQ8Vp3MX+auGlQPlou/VFG NmmaK+ppMQuSMCdpWCvo3gus5x4y+DqRL8/H6adzf3MNP9qHeB/EPRqFksmJ0PKahbNx TA4eHprSA+8IdaxWNKgoW8dP72WbB1S1fVMH4jgd/7Wk1CAYzakn1x79TPVsxjM7thRK 0vf4zAEhrpiwhloE3BI9KKI1EIq7ZRmbwu9BiHFKvi2bM+l9sXhdFNMMPLLnZlnI/qaf LZWQ== X-Gm-Message-State: AMCzsaUWNk0zu44NMol+BqvEGfJlDDNtJLwHIBte0Q3dLcV2KhLlBRTg 6KlcEHjWtAndGHpGUXYXHNn3Gg== X-Google-Smtp-Source: AOwi7QAFMVsigZmf+jtWKpdkK66sDWbPv7bnC8GbnSV0muyf5OREZH+0Dj+ZxgkbKZQ8qzfte/sh+w== X-Received: by 10.101.91.193 with SMTP id o1mr11183813pgr.75.1507619479654; Tue, 10 Oct 2017 00:11:19 -0700 (PDT) Received: from roar.au.ibm.com (220-244-152-14.tpgi.com.au. [220.244.152.14]) by smtp.gmail.com with ESMTPSA id y4sm15774117pgs.19.2017.10.10.00.11.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Oct 2017 00:11:18 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Cc: Nicholas Piggin , kvm-ppc@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH] powerpc/pseries/cpuidle: add polling idle for shared processor guests Date: Tue, 10 Oct 2017 17:11:09 +1000 Message-Id: <20171010071109.31207-1-npiggin@gmail.com> X-Mailer: git-send-email 2.13.3 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For shared processor guests (e.g., KVM), add an idle polling mode rather than immediately returning to the hypervisor when the guest CPU goes idle. Test setup is a 2 socket POWER9 with 4 guests running, each with vCPUs equal to 1/2 of real of CPUs. Saturated each guest with tbench. Using polling idle gives about 1.4x throughput. Kernel compile speed was not changed significantly. Signed-off-by: Nicholas Piggin --- drivers/cpuidle/cpuidle-pseries.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c index e9b3853d93ea..16be7ad30fe1 100644 --- a/drivers/cpuidle/cpuidle-pseries.c +++ b/drivers/cpuidle/cpuidle-pseries.c @@ -171,11 +171,17 @@ static struct cpuidle_state dedicated_states[] = { * States for shared partition case. */ static struct cpuidle_state shared_states[] = { + { /* Snooze */ + .name = "snooze", + .desc = "snooze", + .exit_latency = 0, + .target_residency = 0, + .enter = &snooze_loop }, { /* Shared Cede */ .name = "Shared Cede", .desc = "Shared Cede", - .exit_latency = 0, - .target_residency = 0, + .exit_latency = 10, + .target_residency = 100, .enter = &shared_cede_loop }, };