Message ID | MEYP282MB402614DB5A4625255B689F06C3389@MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp500930wru; Thu, 3 Nov 2022 05:37:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6FPuofdDFGgiCVWFe/tDm1KF9f9q+GYh+oR8xHvwzgaEWOwJeZc9fXoT3t74WgYN3BiwnZ X-Received: by 2002:a17:90a:5781:b0:20a:9962:bb4a with SMTP id g1-20020a17090a578100b0020a9962bb4amr47097953pji.185.1667479060024; Thu, 03 Nov 2022 05:37:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667479060; cv=pass; d=google.com; s=arc-20160816; b=aS/unPwXGFivo2+xFvzmJaeZC9Wb+QamhOvBQpeVcIO3OGjADEse6s7f0lSZtBplJi AqdQvXp36Bu7gcBurcDkh5noohBlpiVYOtY7Jg+wW4g1OsmlX94yp8DaB0MJ/5JKfdtt wvL33DBSAips1f1T3ApA+xBThNGNpUnk0yNLo4z7B9pcE6lI2441iPl0oEwzhWhcH+4T lZ0PDMe9aLxl2PiJITZKcvffNo7Qji70n+sjv6LloJr8cuQZI8bPwFjzgP49Ic/pNifS VUkORiFEOaXYMwS2JB3O/wLW+LTXcQALOmQB8LmgellU7/LbKADAqgS/w4J4hE2Dbi4U p1eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=tPC8DSSjzaUDc1d0LQe3616OCJpMBf721vuenp4E/bs=; b=HEYLPHm2i2cd5gxy/tQxh/2M+bDjeEWskWP8qJA7RlfxRazD6JfT3JxhD4i58h789V da7cL36CwUM7FImZw7EIukb4DF7LscLI53QL/Kne0ExfE5m0HCCDXe7ukzASBqBcV+FO kHt9L+Z/Ek66yFb3JbOlvtFpUTzNapgnNbHtU4O3bd68adUZLqstpHiqbGcMjp367XxP g/vf90pjhg1E/ZLep+KU8V3cxfmtvt1FIoo2f6iCk8Oe5DU/CB75lOi4VcrJVSaFzKnI C/5LZgnQHPWdBKGpZ4+kIbnRLrbvz1EDwyHu4K/0b8feBHN4hwf2ivIUt4Ca0DQX8VqJ NkMw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=Ko0+XaoC; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 22-20020a630316000000b0042bc6e8d3f7si957308pgd.642.2022.11.03.05.37.26; Thu, 03 Nov 2022 05:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=Ko0+XaoC; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230098AbiKCMNj (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Thu, 3 Nov 2022 08:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbiKCMNh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 08:13:37 -0400 Received: from AUS01-SY4-obe.outbound.protection.outlook.com (mail-sy4aus01olkn2150.outbound.protection.outlook.com [40.92.62.150]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7A0C103B for <linux-kernel@vger.kernel.org>; Thu, 3 Nov 2022 05:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mLAEh8vq3SnzS6IUUoag8PPFtSjXm4N0dI5ZfkbjLEmuGb9nDPxRkxCz/ZNqwCQyopbemawv+s36LL2PaL0stBA6KdlALgdMlKMAbHRmiOnDQNjyZeZtgbgR7j+GuVdCSOf1hhM3M0xpmM0NOFYsTKbru2jbnp3lFFdWJAtbUfXe2/0W1UnLbB6s0O/wJLE1wzHUBYywG13Ky3SWXkn72hsKxu8iJQyTza9zbMgWfuyxmYWL3SKr9eaNI+jNC6EuTYeqiANSzJAeuprfyT5O50/0GzO/zdOQ2NzfMqzk06FAtzMRjEL04y9qKN4wNAUCGaPOA+QwY5gUr9uUwr7ecA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tPC8DSSjzaUDc1d0LQe3616OCJpMBf721vuenp4E/bs=; b=nhaB1ojwpO+wxllEwXx57Z5WvoVb7W8i/F/0qAsy6DssjIqJrZiDzDGcM0C+Y2VASD6e7MWk6pK97vrPHNjwcSZ4nXonbqi8i9VIggoIqvs73kCExlTxZPkdJMVKSUXhOsD1b9UtAD09B9+8u+KXCnLjetY4boXjTfdvjdSbM7qsZJElAYIpv03hvKu9s7CLwmoiTs+P1m/hhrcv6B4iWlRScV5z5rysOsPjOGNNKNy8iH37HsIgCqz8SfRCYVhShdkeQ6LNm3aV58cka3PHh0IMBTYPGvGmfyorXVZGveJn8xo6x86cunRbHpyQ1r0eirXA2r99lAQz6sTYWtm8bA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tPC8DSSjzaUDc1d0LQe3616OCJpMBf721vuenp4E/bs=; b=Ko0+XaoCy44ADQ0VLIQsi6P1Rp4+oSKJ3akAyg724xGJRb1gkJzlpW0XzKFxHkt7ohq5FJvsOz+I6Neuf+0eYkBu9m7EnWswU9z3yZXSDBQfBmXWNCMaX1zY+nLYay/3FiYpwMfSUkC9ojPv/S6bMceF4DM2kI7jQqQSy6F4QL7W62lSVR9dWSE/14rhKmfq1SsBYhDeeI92qk6IrZ9BYI/oA+PXyAvBYfYlJfPZS2I1zWPbBRH/6UPmvQSFhYrs++goF0udy1/lUXwaGyBCYWmNZH+yWG/iPeH/Ej9+QlEkmaWTcNneynnjuzbUTjb0QpeYASDuo1tNE6X2oovYNw== Received: from MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:172::10) by ME3P282MB1587.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:ab::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Thu, 3 Nov 2022 12:13:32 +0000 Received: from MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM ([fe80::8e6c:7cd7:be5d:66da]) by MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM ([fe80::8e6c:7cd7:be5d:66da%8]) with mapi id 15.20.5791.022; Thu, 3 Nov 2022 12:13:32 +0000 From: johnnyaiai <arafatms@outlook.com> To: jgross@suse.com Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, johnnyaiai <johnnyaiai@tencent.com> Subject: [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU Date: Thu, 3 Nov 2022 20:13:19 +0800 Message-ID: <MEYP282MB402614DB5A4625255B689F06C3389@MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM> X-Mailer: git-send-email 2.27.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [eVk9YxkbenbI9qG9HEKGEWSKQTydVAZ5] X-ClientProxiedBy: SG2PR04CA0214.apcprd04.prod.outlook.com (2603:1096:4:187::17) To MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:172::10) X-Microsoft-Original-Message-ID: <20221103121319.3390542-1-arafatms@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MEYP282MB4026:EE_|ME3P282MB1587:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fa08f63-312d-4773-eef4-08dabd94d2f7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HpGjtO34Z5sByMYWxnXhck/TgnghaaqlSrakbim+CTG+LJtmKkA+jQuDonX6cEouYLNY69jYa3mI3c/n6bl/CZiCcwePXL7jT9AsVTLt0jmeaJySXpxcd6TI3LS+LKs3YA/v+sQnqBu6cwb5VF9+bDmHOTth18zUwRnJkSlvcCGoB5tp18e6p284p58XqsNOjK2woSq5CVafmBJb4MG2zhdzMlyp9crmzUQ2mursqtulAxsgbh42eL1rGLYOyag4Swqj2Qkfi7KIhS21/z8YF6BEGvvTDkXleRDHVCtUpONcQBnoo5iLXtXum3gXkOAsRseo/wQ7NP3Js/kZgkWFf1Nowdi3yUqNdRBbie8O3OC9Vyis7Iv9kf8KHWuUTFeg5eY4vyi8RJmFuGW2KAnCeCmKORirnqKxVuax+4oYeccaj7P9jOnjF5KJ2BfLLB430iFqnxQv/oxjBsXEZXixW1HzkjlRc35D+T/CjpwhpAdei4T3xJls142yHU2i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2BYYUlo2XuGBUwX/+TJpspISYDsOeOrVVXd+iI4wN0otiz94XUlher6W9VRGsvc5N3mbpvdKCvvlpfZy+EEzahGoJsaSltIm1scjBgpBYsbfFNa9BGtWeZHj1EqIDW9CIobD5+6xvXewBNZ+TWSQq37XfxRiQ9ngjmOkCichJD5K5UlKn/IaS9RmLU3XcUc2vuypynfctDVYdP7gkx/y0i4A7JHHySHa0R6ZoweTrDLwbGVq+taLVE39vGN/No1E0kIE39EcVfOVpPNdHa4oJBeV6QTfPe3lLLgi6rMfcvZiW+swGjrmI8XzxQ3LKCSH7dNr5B8fcLik3g2LqCH2do6AsOnjsZs/WaERIVomKwRzY2+oOFU8TELJS/rnsPfSTYARu9iXOkAqq+wZM2lk9v70KMybv719W8E2f+GBoZwZC03HVRizYQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fa08f63-312d-4773-eef4-08dabd94d2f7 X-MS-Exchange-CrossTenant-AuthSource: MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2022 12:13:32.2382 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: ME3P282MB1587 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748478229377545142?= X-GMAIL-MSGID: =?utf-8?q?1748478523218877339?= |
Series |
locking/paravirt: Fix performance regression on core bonded vCPU
|
|
Commit Message
johnnyaiai
Nov. 3, 2022, 12:13 p.m. UTC
From: johnnyaiai <johnnyaiai@tencent.com> virt_spin_lock() is preferred over native qspinlock when vCPU is preempted. But brings a lot of regression while vCPU is not preempted. Provide a early param 'novirtlock' to choose would be better. will-it-scale/lock2_threads -s 10 -t 64 baseline afterpatch 559938 2166135 Signed-off-by: johnnyaiai <johnnyaiai@tencent.com> --- arch/x86/kernel/paravirt.c | 7 +++++++ 1 file changed, 7 insertions(+)
Comments
On 03.11.22 13:13, johnnyaiai wrote: > From: johnnyaiai <johnnyaiai@tencent.com> > > virt_spin_lock() is preferred over native qspinlock when > vCPU is preempted. But brings a lot of regression while > vCPU is not preempted. Provide a early param 'novirtlock' > to choose would be better. > > will-it-scale/lock2_threads -s 10 -t 64 > baseline afterpatch > 559938 2166135 > > Signed-off-by: johnnyaiai <johnnyaiai@tencent.com> That is exactly the purpose of the existing nopvspin parameter. Juergen
Thanks for reply! I think nopvspin parameters controls pvspinlock or native spinlock. a vm guest always running on virtspin wheather nopvspin sets or not when EXITS_HALT not supported by hypervisor. So provide a missing parameter 'novirtspin'.
On 03.11.22 14:58, johnnyaiai wrote: > Thanks for reply! I think nopvspin parameters controls > pvspinlock or native spinlock. a vm guest always running > on virtspin wheather nopvspin sets or not when EXITS_HALT > not supported by hypervisor. So provide a missing parameter > 'novirtspin'. Your patch is doing: static_branch_disable(&virt_spin_lock_key); in case your parameter has been specified. When running as Xen guest the related coding is doing: static_branch_disable(&virt_spin_lock_key); Only when running as KVM guest there is a difference, but this could be changed by modifying kvm_spinlock_init(). Having two parameters with the same or very similar semantics is not a good idea IMO. Juergen
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 59d3d2763..529cf23fe 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -107,6 +107,13 @@ static unsigned paravirt_patch_jmp(void *insn_buff, const void *target, DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key); +static __init int parse_novirtspin(char *arg) +{ + static_branch_disable(&virt_spin_lock_key); + return 0; +} +early_param("novirtspin", parse_novirtspin); + void __init native_pv_lock_init(void) { if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))