Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1494162rwi; Thu, 3 Nov 2022 06:04:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VwEsxFMWrdn5rD97+9x4YZHotB+KxX8Q1wze393FO6Ccp6FMnVP4m17eLZ1BJxycmogyD X-Received: by 2002:a50:ccc2:0:b0:460:4db2:5006 with SMTP id b2-20020a50ccc2000000b004604db25006mr30007925edj.369.1667480649792; Thu, 03 Nov 2022 06:04:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667480649; cv=pass; d=google.com; s=arc-20160816; b=CLon6KR1HAWEDn0PZ394keGkfrVmQxNBJLfXWV4DAWZgRDXYEop/s8RU1ZlKA9kmV9 OMHiEBjWhgEACBm+BLZiY44GslkqnHeGRu9iUPtfJ7qU9I1NAH2IqGCaL+tMxg4LNzDL KtJVcADYqaynzzT4mYi9nV0K3TDYl+s4gQhKan3Oew+j0wc49D8IFpbf27yYBYAel1Fe lUrHnOglZXRrOvCqSC9AC2NjtC6LzZkmSXGTyeXQm/9fCKq/1mAJTwNLjFg5mjufoVcE g6LnR0brzuC8ottDXXLLpRzTZKUId7yebD0uh5n1+zGnokIlgtD7MyGXbseQZiPznIH9 LFvw== 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=9yX3ezV2JvBkM86f//lxDyPUaeQb1gYHJwFXmrV7Hdg=; b=v8vabnOijunVFHqT4u8TpQvmSI9PTvjLw06NEtExz2yQFJn8zwfET9H8dm/8ksc91A 8Z7ZGghKzs/qNQhjBxBRFU2NkHCfu6XUKVYV0v1WPZajUT+RwRUZ0QXsmf4/UNecgMnN 24BW8mbonbU6oku3LXuVxoH81o4LaJXNrpyxpvpQtscw90zhWAYXUTF5iJnGssjJTTXO pR3oYAatlU5Z20chKvJtUBvkfpYPS4epJyzHql3LDQFqSnDmAxxqa/k+67Q+q5D/NALl GPaLh7SDou/Hg23EdelUzpeMeN/S/HgWGdtulXY252y1koMjfyy+/7ZRcm4cRdtV5yAl sudA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=p9TZx8gu; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw30-20020a1709066a1e00b0077b2e822b5dsi1507356ejc.674.2022.11.03.06.03.37; Thu, 03 Nov 2022 06:04:09 -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=p9TZx8gu; 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 S231375AbiKCMLB (ORCPT + 98 others); Thu, 3 Nov 2022 08:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231534AbiKCMKh (ORCPT ); Thu, 3 Nov 2022 08:10:37 -0400 Received: from AUS01-SY4-obe.outbound.protection.outlook.com (mail-sy4aus01olkn2160.outbound.protection.outlook.com [40.92.62.160]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 513495FFC for ; Thu, 3 Nov 2022 05:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SIOcWcvynZTg7v9DvhPIR+JDKUq7hUN2/wzYwAuz9bRnJ8gzadtjTxIXKMW8qrcVUSUkjQmNqTrBfdoYHJ5PZNbd/xvpF+ufvLOYLBbYLIHaP3J1qIfQq2ar8q/vtnmRDf1dxCVJZl7YFdQkcgWGp4ahNrpHdKXEX9t9dcK9JnmhuX1bbNL+1YBWeQsPqKCbMn3Cm4sbPqCFup3IDOr/fNzKtWc1vxAXy8o991erAsJsS/zq/fKMdqGHCsOCAIDlMV2ncVHWPFYW1PvfN9XADca4Y05A8QcSbNRnD7e1XtFmf09+o2FltMOFUqsDt4vMR/RcelIhmKQP4Wm8QreS0Q== 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=9yX3ezV2JvBkM86f//lxDyPUaeQb1gYHJwFXmrV7Hdg=; b=UB4ZaYJXtTZAgLzMu9eNJJzIgaf3s/XSUTTwTsT5LLlE1xCcAk/UpApMKNzXghPTzW1SZnCAvmeI8kgLvj7HIq/9rjq54hcPXv+4GuON0uJ1Ty2KoViQUtxy8rWQhp/bvqY0g+dvz1UtG3TelduyrHEpoHCepB+TAFGpMIwIQtI9meKE9slvOuh75QOUmHtxgvFs/Uo4xf2zUavptD0XnLdCZUGoR7p/C5bb/Xtr6wBYCWRJe5SiXTvI1Kwjpv1zEmEaHQLl6b+gIsHJ0gnb0yUKDsMXYVJBgPJWaQTcdjjzZfQzC9g+wJSjWo0S9vK014079LbP7WDbjwS5uc/amQ== 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=9yX3ezV2JvBkM86f//lxDyPUaeQb1gYHJwFXmrV7Hdg=; b=p9TZx8gu2A4zaa3RAsa4AWrZqMbmMgZpf8wRv5eK1AG+QJAHTni+msEhNftSrs17fx5Da3jNJZGGNh54VpYb64IJDLiQnS5Zfa1+mokGA6qegkEuiFTjg6lLWCljNuFqhSgWgq7uinI04sqmLWw+rjYZR8ZJAUG4AXAjlcYG9NftLxmLwJshEfoz12TgGd1FWn790V3uTJQYRr5TdrDUkxfRLQCmu34/zeoGpQAPJfIz/8UykAEVVCD12TGJrxzdJ7+//K7OOHBZc8mAR5ZxI5v3DW4CN2jvtnOo9cbwUpC090sSQBzhLFpc8hYjXC8jaCYFTGtI+YbcahHtJHnpyA== Received: from MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:172::10) by SYBP282MB3043.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:13e::10) 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:10:20 +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:10:20 +0000 From: johnnyaiai 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 Subject: [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU Date: Thu, 3 Nov 2022 20:10:06 +0800 Message-ID: X-Mailer: git-send-email 2.27.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [wok41DQVUGvISiE4Imh1idQppDAbJPFL] X-ClientProxiedBy: SG2PR06CA0207.apcprd06.prod.outlook.com (2603:1096:4:68::15) To MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:172::10) X-Microsoft-Original-Message-ID: <20221103121006.3389036-1-arafatms@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MEYP282MB4026:EE_|SYBP282MB3043:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cbdf7c6-9089-428f-8b85-08dabd9460e0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RY+dSY11aSq2s3rDFALEr32ZCPSQ7ikyKOjLS6N28T9nhvxDi3H/weEZbGeg+Di2KwfbceYOzB54AVJQ9oZrcDUg48j6DXjIvi/exXDTMIZbfRg6kMKHloWLS0z3OGkoS8YG7i+A/CIdDVxlOMBwdvylXC9HlBPJ/GG0hYMeWz59a85lWDWeZmXykotSnSE4mrsl7Eyljx/xVDnogigAgGWdpK6JmhjASCcgdq0haycQqoWHAxQCXVeCTYBL8wrcoQmYg8OhclYaLIljSdrDKqtmr+mtAw4wkV7X92DIPH/BwH8JodbcEf/2bG04HVV1D6fdhDKC/8xE50HrZrAj43jqxX/DCVM5EhkXMSmNmURAIwos3duabG27wxolDVnhVs0gLDZ24CuxSY1DxuGkxd3vXpY9z8hdz1m/Nod15HQSRO/a+NzV2aWTo7DJd4ixhlrB1zbVcv2uC5s6IEcJyx8eVh2Ypo6gmBjGTOI3EKzt5LaF5UJpip4TCYZQehu7UtRNVE9H8X9/PpLuzfpw5wcDsCKtHiG2cippk88TxJ391kE0JdD97eF3hZP5EWtLIN2GSXCXlbtgShzP/HWhbFDelmxAeq53p7DCuSXR9QcK3WY2Ur5f+8a9xuDmL/Dpbm5WTjUZx3ZAG9CxnrfFxA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lgrOFkV0gj3VrJZYM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ascii?Q?HxohMf/iqF6sB0BSmHyg/24PCL/oD945T36815ODfz2Tn4qw3DTP0kZ46GyV?= =?us-ascii?Q?FHnzOxn0WYKBsRYHMeIHy9oaJc4RkbKWjXsTk3mPpoqCqab9EY2COItASPh5?= =?us-ascii?Q?5DBJ5GISd4E6Z27bMFhdJ1vDsIRjcXCnbP/KUfx3FCtL7ltazH5V/VjsYziL?= =?us-ascii?Q?3Rxcql0+KXTJHhKjEdjUTf/A7ueTlWHkSmnCqpogIwKyDnU3sS+Zg688EZbc?= =?us-ascii?Q?A8feSKQAz7s0sk0epnqqr/K7Km3M7vwXyofDGh2bB9mtPRltL2QA8DIbkWnq?= =?us-ascii?Q?COHgVbB/4ZAVH/Z/vUY3xB8yok60DmdbZ5GcMlW9aeqAz+xyR2c9vqw9qUw3?= =?us-ascii?Q?UOcOgL+9/AQ+MK8juV+v2uyaqihh1qEUMM90p74HCg=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cbdf7c6-9089-428f-8b85-08dabd9460e0 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:10:20.7609 (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: SYBP282MB3043 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,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: X-Mailing-List: linux-kernel@vger.kernel.org From: johnnyaiai 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 --- kernel/locking/qspinlock.c | 3 --- 1 file changed, 3 deletions(-) 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)) -- 2.27.0