From patchwork Sun May 21 22:31:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 96926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1087690vqo; Sun, 21 May 2023 15:53:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hFmbuR1RXJgoP6940LzNG5Cgt75rOxnKsVUWuhUpL9gujl7C7WsU8Asvc80tc+aM22WYi X-Received: by 2002:a17:90b:1003:b0:255:5bde:e6cc with SMTP id gm3-20020a17090b100300b002555bdee6ccmr2281854pjb.17.1684709610016; Sun, 21 May 2023 15:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684709610; cv=none; d=google.com; s=arc-20160816; b=zQaoSJU7UoeVWtrtEP01Tb3qYGqo334cRJtpFl398hj7peO/KHEe0H7pIP7Gw4e4Mf PbBZH6u73B/ehu0hoG1+WK0kKAg5z89ZOX2WNo23GvvkHGLRctCF60R/WBDvE9VLGvKP bYJHtAomB9KUrNrtFrtlcOfRlcbitsIjk8FKEdKGdveriPipUiCoD+CzbXKAugoYJmwO ULJ9ZnURES4M8Ksb6+fYZ5b0R10sEphlAynTZho4HJaEBnpoNHcHTDkoWTdVimFrL28u x53TuMqsFshad5vceKx3Ve+ldKvkDaN4k2affAx6trZ8rUkC8ohcNJ02QkGen+JpzWTc 2/og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=FXoxgR8soaAJE0zXIWRGojqbl0zMimoMys8rNjtPPdI=; b=0X8iiOGrOQBVXmToc9uYCCnDR2QT9zgPAHNfat2+xeVjxeztOaf+NcVUCcb0ZG5dmE u3Decqby1Ztr+Y6zVenluV3UgKdvEwrWO9XLGDshaWLv/tMksqUBj/0p6gurcb2VsAmd 9hq9RMEmX+zarsyNMcTN7jjwwdqKelpv64NaRxfDXim0PbpSra5GTJaAAJlDwj7RYX4n Gw6c8Rh+avuLv3BdKBVBa+IYzpNqDLNnkLWbJJL3CqVpt/97H21OERh+mVeHDxBccMgs rEKpom8YL3ugaBerrILfh76xE3C372FnK1lktCrOzms1dFbHQf0u9MCAYb8937bn6h3P JKiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=bpsN3wnd; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=b+Mj8sBt; 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=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020a17090a4ec900b0024e500f373fsi3887433pjl.82.2023.05.21.15.53.17; Sun, 21 May 2023 15:53:29 -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=@flygoat.com header.s=fm2 header.b=bpsN3wnd; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=b+Mj8sBt; 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=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231434AbjEUWdA (ORCPT + 99 others); Sun, 21 May 2023 18:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231446AbjEUWc6 (ORCPT ); Sun, 21 May 2023 18:32:58 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A09E45; Sun, 21 May 2023 15:32:28 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 36B905C00F0; Sun, 21 May 2023 18:31:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 21 May 2023 18:31:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684708291; x= 1684794691; bh=FXoxgR8soaAJE0zXIWRGojqbl0zMimoMys8rNjtPPdI=; b=b psN3wndsrJr0wl4MmXW08m0fuIXwoyL1ZI63w4JqjW/QURuL2OMTcgVpKBSKtB28 k9MWxvjLL+bKzXqkvD+Dp0bgfBrwt+QvWF4DkP1Ucod53lE0kfVlV7g9wpLX1Thw IM6In7ZiSgYovWhTba5cqnLyYHk8OWWA7FKQT5/xlr/fPtDC+ZLzIkYN6ws7de9D Gum341qC+0eF3Vm9MXS+D+U3NVTEbx1o6b0syykxu7DkDVoUiVfL518uNkhuAEva AptBfa7R5EXEuS7Yig5jozTfAq4jmorvVLFNyijrc3nILoA3jnlLzQSA2KZKzk+M X/mGCN56abrIBhbCsv6jg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1684708291; x= 1684794691; bh=FXoxgR8soaAJE0zXIWRGojqbl0zMimoMys8rNjtPPdI=; b=b +Mj8sBtXEWwt7W2MMwZD07ND+pmeZW8vzGbaeBIOB1u3GG9m94HdUCY233nBNLkf LediTkWWk3aTYVr0ZxsUrPulAmdhV4j0FYAmcxxlENuz6GYIearFrTEJqZj3LZVY RoUuha7EeAh23O9+PtB/hC49WWJ78uH4qeb4BTafq6YM0vM4CTnAC+sPBsrZskN9 poq/vTJ1tr5WsNtKD33W5e9uOaC3cxi4hhXpfSO0jmifqAPRbQWkbx1HhJ1ysGG5 H/uSjNOJ0LREhomswpdOH+c0H2UBuhsSpLx3ExdR5Xch/Tt+VJ+J09WthOsVlB9F 1mOE4QOO0o2xBnWIb4zCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejtddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 21 May 2023 18:31:29 -0400 (EDT) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, linux-doc@vger.kernel.org, corbet@lwn.net, Jiaxun Yang Subject: [PATCH 1/3] MIPS: Rework smt cmdline parameters Date: Sun, 21 May 2023 23:31:22 +0100 Message-Id: <20230521223124.21911-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20230521223124.21911-1-jiaxun.yang@flygoat.com> References: <20230521223124.21911-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766546064367880702?= X-GMAIL-MSGID: =?utf-8?q?1766546064367880702?= Provide a generic smt parameters interface aligned with s390 to allow users to limit smt usage and threads per core. It replaced previous undocumented "nothreads" parameter for smp-cps which is ambiguous and does not cover smp-mt. Signed-off-by: Jiaxun Yang --- .../admin-guide/kernel-parameters.txt | 4 ++-- arch/mips/include/asm/smp.h | 2 ++ arch/mips/kernel/smp-cps.c | 13 +------------ arch/mips/kernel/smp-mt.c | 3 ++- arch/mips/kernel/smp.c | 18 ++++++++++++++++++ 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 91963d3f0d5c..515cd1f88ea2 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3830,7 +3830,7 @@ nosmp [SMP] Tells an SMP kernel to act as a UP kernel, and disable the IO APIC. legacy for "maxcpus=0". - nosmt [KNL,S390] Disable symmetric multithreading (SMT). + nosmt [KNL,MIPS,S390] Disable symmetric multithreading (SMT). Equivalent to smt=1. [KNL,X86] Disable symmetric multithreading (SMT). @@ -5743,7 +5743,7 @@ 1: Fast pin select (default) 2: ATC IRMode - smt= [KNL,S390] Set the maximum number of threads (logical + smt= [KNL,MIPS,S390] Set the maximum number of threads (logical CPUs) to use per physical CPU on systems capable of symmetric multithreading (SMT). Will be capped to the actual hardware limit. diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h index aab8981bc32c..a40d8c0e4b87 100644 --- a/arch/mips/include/asm/smp.h +++ b/arch/mips/include/asm/smp.h @@ -57,6 +57,8 @@ extern int __cpu_logical_map[NR_CPUS]; /* Mask of CPUs which are currently definitely operating coherently */ extern cpumask_t cpu_coherent_mask; +extern unsigned int smp_max_threads __initdata; + extern asmlinkage void smp_bootstrap(void); extern void calculate_cpu_foreign_map(void); diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index d7fdbec232da..474318bc08cb 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -25,24 +25,13 @@ #include #include -static bool threads_disabled; static DECLARE_BITMAP(core_power, NR_CPUS); struct core_boot_config *mips_cps_core_bootcfg; -static int __init setup_nothreads(char *s) -{ - threads_disabled = true; - return 0; -} -early_param("nothreads", setup_nothreads); - static unsigned core_vpe_count(unsigned int cluster, unsigned core) { - if (threads_disabled) - return 1; - - return mips_cps_numvps(cluster, core); + return min(smp_max_threads, mips_cps_numvps(cluster, core)); } static void __init cps_smp_setup(void) diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c index 5f04a0141068..7729cc733421 100644 --- a/arch/mips/kernel/smp-mt.c +++ b/arch/mips/kernel/smp-mt.c @@ -46,7 +46,8 @@ static void __init smvp_copy_vpe_config(void) static unsigned int __init smvp_vpe_init(unsigned int tc, unsigned int mvpconf0, unsigned int ncpu) { - if (tc > ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)) + if (tc >= smp_max_threads || + (tc > ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT))) return ncpu; /* Deactivate all but VPE 0 */ diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 90c71d800b59..8fbef537fb88 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -73,6 +73,24 @@ static cpumask_t cpu_core_setup_map; cpumask_t cpu_coherent_mask; +unsigned int smp_max_threads __initdata = UINT_MAX; + +static int __init early_nosmt(char *s) +{ + smp_max_threads = 1; + return 0; +} +early_param("nosmt", early_nosmt); + +static int __init early_smt(char *s) +{ + get_option(&s, &smp_max_threads); + /* Ensure at least one thread is available */ + smp_max_threads = clamp_val(smp_max_threads, 1U, UINT_MAX); + return 0; +} +early_param("smt", early_smt); + #ifdef CONFIG_GENERIC_IRQ_IPI static struct irq_desc *call_desc; static struct irq_desc *sched_desc; From patchwork Sun May 21 22:31:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 96935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1090491vqo; Sun, 21 May 2023 16:01:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BMe96nx2n8KyC55Bdn14pz4CPlHVjfbrO5PLWvYfmn1RoHG7yVMtLndjbbRv2PVg1a7lP X-Received: by 2002:a17:903:1249:b0:1ac:4d01:dfec with SMTP id u9-20020a170903124900b001ac4d01dfecmr10696398plh.54.1684710098307; Sun, 21 May 2023 16:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684710098; cv=none; d=google.com; s=arc-20160816; b=igf2VvFayNxfDG2Bqf/u1ztHqXFX40vooFKO0TgMBpi8CqlPDtyO3mvLQWS+ZByP4p 9vBZmGwWTJymBpM4ehZOqKJrjKgd9SDIbDZM/bZdkLE27Gdtvs/cYwFs6Tjt4u2ceyZR 0YGJDJRhcArsgPmJTXBukX8Z3joAJyyZ9OfVDY1pQYtoBbuzMLZ/pJrwJczWItGPoa5V TUIOlVpvo7YDK3+L18CO+aP7ezrDRP2POmPCkuCnvTlFe6wFXwBOKGFngO7627iCyZTH 1YJflUdWtrQdXTP2wDcK507ZyYfSxhbJp2Ffism/4aqtONnoV+UgiIQhjS1mKO6BDAAZ T0Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=zsryuoGv1+n96XBFSmSM7IggLdXyxGy+UDE+DUNZJ18=; b=gPYZ8RUiYtKH9M467Z6tbI6lBDF2zzWfUN3vKc+HBIO3fzXarbfDTl1FGR5tbP/Y/f 0/RQ7FhveHt/1rsrYkJMoaa8PrqDMxzdRNx2l7IK2Bz1BkLl1plLgVDNKbEr583SIZHJ 07EKAP8ame91lsBe6wDh6jzc5j4tYEUDeFlMP150Xr2w9lacKWXFmpNuZKJqlDuggEG3 vPlNTV51b2DMwiAstw1/eOu1wSbAP3PtnIFN6FewufZf8vCHk6s/kE0S/BhYmX5eI2v3 c8K9q2G7Kj7ADtKYR1QNhsbEMfku4SIa+q+b0TnchnpemA5mxDfuup7DkF5MjKx9sMJP 0lnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=BqlYXmYv; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=o6cK3P00; 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=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a170902ecd100b0019f3064da41si3783947plh.383.2023.05.21.16.01.26; Sun, 21 May 2023 16:01:38 -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=@flygoat.com header.s=fm2 header.b=BqlYXmYv; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=o6cK3P00; 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=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231483AbjEUWdi (ORCPT + 99 others); Sun, 21 May 2023 18:33:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231516AbjEUWdh (ORCPT ); Sun, 21 May 2023 18:33:37 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AE91FE; Sun, 21 May 2023 15:33:07 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 907EA5C002F; Sun, 21 May 2023 18:31:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 21 May 2023 18:31:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684708292; x= 1684794692; bh=zsryuoGv1+n96XBFSmSM7IggLdXyxGy+UDE+DUNZJ18=; b=B qlYXmYvBpidE+Qenb6cuppxjzlhYt1a5tG/Bsm57DLr77SPTNbcMrNxqLFWKEpEh ne4fRaUzBcyw56zQAVCwlf5nQKTDdvgBfgOXqRr4AdP7tqAQUmZF1Qd1yBrV8yut Ehjx+O5Psu2JpNZDk/DX+evM4tnTMUAK4YxWud4t5CbBUj33hWD2yIBtfFRNg3u9 h2VJRoxxjn9dM+dU6oJp/H34RoPEkU2hhRF8DawuabAnUqOjCR4QoRxUX2rZISG0 5l3inRBilBrL08VAk32ebWkqJS76i19IHc0Taci5bRsKSOK1MDnQ86yRn44iUWdq BlMfpKsehBLJzA2gXZhWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1684708292; x= 1684794692; bh=zsryuoGv1+n96XBFSmSM7IggLdXyxGy+UDE+DUNZJ18=; b=o 6cK3P00kK6WJNedgnlsGRiKp/ysFxsLRHVihy92pzGEwdGI45rIyDDmZjCtocenw wrIFGnaue+Z1e1cPEubGXUA32rNGoquy1pSMWidxNVS0yd1V3IBdRybAmk1CRoY4 edHcLoiiafiilWpQz0W+nzDQXu7PQQfW+ADO8wg9Px9DNnl+lclf578i6S4Zm1Ka 91t8JnGdkciTljB7pT3y2VLDh5DJlsv565DnoCStRQAJvVMit3DpJBKm3L0kc0F8 QUX/j4eDzS6UGcTzBJmlA7F4ch5HZULOIV9qb0BrBKHsVejUHdM5zWgO0kz5shAY fNOi9NtwNmaHi+aIoYp4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejtddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 21 May 2023 18:31:31 -0400 (EDT) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, linux-doc@vger.kernel.org, corbet@lwn.net, Jiaxun Yang Subject: [PATCH 2/3] MIPS: Select CONFIG_GENERIC_IDLE_POLL_SETUP Date: Sun, 21 May 2023 23:31:23 +0100 Message-Id: <20230521223124.21911-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20230521223124.21911-1-jiaxun.yang@flygoat.com> References: <20230521223124.21911-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766546575678023801?= X-GMAIL-MSGID: =?utf-8?q?1766546575678023801?= hlt,nohlt paramaters are useful when debugging cpuidle related issues. Signed-off-by: Jiaxun Yang --- Documentation/admin-guide/kernel-parameters.txt | 4 ++-- arch/mips/Kconfig | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 515cd1f88ea2..9c502d3aa0cd 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3694,8 +3694,8 @@ nohibernate [HIBERNATION] Disable hibernation and resume. - nohlt [ARM,ARM64,MICROBLAZE,SH] Forces the kernel to busy wait - in do_idle() and not use the arch_cpu_idle() + nohlt [ARM,ARM64,MICROBLAZE,MIPS,SH] Forces the kernel to + busy wait in do_idle() and not use the arch_cpu_idle() implementation; requires CONFIG_GENERIC_IDLE_POLL_SETUP to be effective. This is useful on platforms where the sleep(SH) or wfi(ARM,ARM64) instructions do not work diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 5f52bdecb4c9..e437bf43ecfc 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -45,6 +45,7 @@ config MIPS select GENERIC_LIB_UCMPDI2 select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC select GENERIC_SMP_IDLE_THREAD + select GENERIC_IDLE_POLL_SETUP select GENERIC_TIME_VSYSCALL select GUP_GET_PXX_LOW_HIGH if CPU_MIPS32 && PHYS_ADDR_T_64BIT select HAS_IOPORT if !NO_IOPORT_MAP || ISA From patchwork Sun May 21 22:31:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 96936 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1090640vqo; Sun, 21 May 2023 16:01:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QBTBxOzWavO9VOSTV0qq90xFw7KVyGshFEefSMxJNXfptUK2yL8b8riKe7aF8FKcwC+RO X-Received: by 2002:a17:903:228d:b0:1a9:6a10:70e9 with SMTP id b13-20020a170903228d00b001a96a1070e9mr9102374plh.33.1684710115140; Sun, 21 May 2023 16:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684710115; cv=none; d=google.com; s=arc-20160816; b=l2ptlNS46m2HpQubOfLwsE0vRQXIbv4+KY1zlHWFGKzvMc+tvcYw/syPCY4VlQH8gh QFE8O6Cr7dNI6ySna7jZUSXvecJezVpBfsqqVZ3f6w5/KJRmaexjUFWjFfeve4BUTJhf QmjTCk98wfi9cqcw1KymW3A7ILQ/hdB0rbXpNA+WsogIVgWvkaGLkbNkUEdb2Hv2t869 QMaIX9WqnEJx3P0bJAECCJSbSvIgBEUQ6iNXutzx1ufWQW1RxKFWCpvWO2FuF0lL1WsL 1zFtmszQlXff4xfX0AjPnj4deKroT7fjuL6seYAlRkcYPFV7KisEH8eqL2Valvc3iU93 TLsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=U6/bYfEfdJ3fMhA2vzQuq00Kk2+AAgQk/ba6AQ72FxM=; b=oUJ56u3d+OJz16D+2G6YO7g92HDUY5/1Xw3SrBEuE7ttpKE4y5Ac5u0xAU68uArT1j CKfl9kSGJsih5dnozKlCdWxoJKLAzhKKddyHQuwzONWnTXfHHKarzI3qPY+Gbat+5w1f FGxitirdBfmIr6W2ZC4sBLi8t2NPEWMtXIcBc6w0s+PSeoXq3LawilyoKP/2IlRjWHqc 9frfp8hOD5LQaDhwCnaGnk3BlJ+5muPoI1yCDztuPtN/LjEwnCm4vyle8ne3SjMbFlt9 oK1R8A2GMk/rETpvLAYtyvGhMRhqpiZ2r+fFSvc4MNxqM8u1IvT+w6I4ChkORDhmN9K9 RkdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=jY102dQi; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=khSs49pP; 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=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170902724900b001ac5dd95bc5si3444101pll.476.2023.05.21.16.01.43; Sun, 21 May 2023 16:01:55 -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=@flygoat.com header.s=fm2 header.b=jY102dQi; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=khSs49pP; 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=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231491AbjEUWdM (ORCPT + 99 others); Sun, 21 May 2023 18:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231472AbjEUWdJ (ORCPT ); Sun, 21 May 2023 18:33:09 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E70B119; Sun, 21 May 2023 15:32:40 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D11665C00F4; Sun, 21 May 2023 18:31:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 21 May 2023 18:31:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1684708293; x= 1684794693; bh=U6/bYfEfdJ3fMhA2vzQuq00Kk2+AAgQk/ba6AQ72FxM=; b=j Y102dQi119pmHqHObrU9VmemtgwIc5xfMzXoESGQnRuZNmjAr8cyC8KwYBIOC3oX 3iScrmkFTFV6YjhndRsQAdICTYow058rWKDC0i4HUUaJJn+U1uJvkPIqxMvt+lIO HUbWlFhdJhm+fAzKh0yRVxEgL29JVlqUz5RZnb274i93A8K+ebfCO3Tvfz/WlRVJ XnK3Vd91GQJfVOWWM7LVbADOMQR6pCzDT/Ivotu5ugfhM1IGKIf/vWn6r8yo/VBA NByDDsrCkhwNze/n7JYgtwpCuSa/YHaW3MxECWQgbCzR4d0sHwVTG/OrFN/le0gd 0px+HpQxoc+M/eujRTxvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1684708293; x= 1684794693; bh=U6/bYfEfdJ3fMhA2vzQuq00Kk2+AAgQk/ba6AQ72FxM=; b=k hSs49pPR1q8viz+c3Mbo0BZ3JEiQ5GBliHmchB9B0MbbeQ399wacNtH1dQU6qwCq oLXTTRrJCiwvwWJwoO82DKM2u0eYFP0K/CaBRTPFxsJ1wm4IeOBIgN/m2SqFBKpz yIoGYTB0uNO3+x3u4Cjsz1WCtrdp50KrspjkMDfzA3lJJdaQfKumn+ILsBzF3h2d YkA5/qDHmiWFaWR+VL/2lCyzOuHxvfV6WXispf5EmDTlC0aj6X6HzxyEvxN+x88H Y6tq3ez9Qj2xopvGZ42Sur0Ln12e1mVhPu3psYeATGvAij8azh0FoSvKQ+oXYfVv eTeFSlLg0VDs6gi02pL5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejtddguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 21 May 2023 18:31:32 -0400 (EDT) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, linux-doc@vger.kernel.org, corbet@lwn.net, Jiaxun Yang Subject: [PATCH 3/3] Documentation: kernel-parameters: Add some MIPS parameters Date: Sun, 21 May 2023 23:31:24 +0100 Message-Id: <20230521223124.21911-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20230521223124.21911-1-jiaxun.yang@flygoat.com> References: <20230521223124.21911-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766546593610492500?= X-GMAIL-MSGID: =?utf-8?q?1766546593610492500?= Those parameters lives in MIPS kernel since very start. Document them for convenience. Signed-off-by: Jiaxun Yang --- .../admin-guide/kernel-parameters.txt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 9c502d3aa0cd..67a0c3f7eca3 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -713,6 +713,8 @@ Sets the size of memory pool for coherent, atomic dma allocations, by default set to 256K. + coherentio [KNL,MIPS] Force enable hardware DMA cache coherency. + com20020= [HW,NET] ARCnet - COM20020 chipset Format: [,[,[,[,[,]]]]] @@ -3626,6 +3628,8 @@ nocache [ARM] + nocoherentio [KNL,MIPS] Force enable software DMA cache coherency. + no_console_suspend [HW] Never suspend the console Disable suspending of consoles during suspend and @@ -3645,6 +3649,7 @@ [KNL] Disable object debugging nodsp [SH] Disable hardware DSP at boot time. + [MIPS] Disable DSP ASE at boot time. noefi Disable EFI runtime services support. @@ -3667,6 +3672,8 @@ nofsgsbase [X86] Disables FSGSBASE instructions. + noftlb [MIPS] Disable Fixed TLB at boot time. + nofxsr [BUGS=X86-32] Disables x86 floating point extended register save and restore. The kernel will only save legacy floating-point registers on task switch. @@ -3678,6 +3685,8 @@ in certain environments such as networked servers or real-time systems. + nohtw [MIPS] Disable hardware page table walker at boot time. + no_hash_pointers Force pointers printed to the console or buffers to be unhashed. By default, when a pointer is printed via %p @@ -3758,6 +3767,8 @@ nolapic_timer [X86-32,APIC] Do not use the local APIC timer. + noulri [MIPS] Disable RDHWR ULR access for user space. + nomca [IA-64] Disable machine check abort handling nomce [X86-32] Disable Machine Check Exception @@ -3882,6 +3893,8 @@ [X86,PV_OPS] Disable paravirtualized VMware scheduler clock and use the default one. + nowait [MIPS] Disable the wait instruction for idle. + nowatchdog [KNL] Disable both lockup detectors, i.e. soft-lockup and NMI watchdog (hard-lockup). @@ -3893,6 +3906,8 @@ LEGACY_XAPIC_DISABLED bit set in the IA32_XAPIC_DISABLE_STATUS MSR. + noxpa [MIPS] Disable XPA (eXtended Physical Addressing) ASE. + noxsave [BUGS=X86] Disables x86 extended register state save and restore using xsave. The kernel will fallback to enabling legacy floating-point and sse state. @@ -3936,6 +3951,8 @@ nr_uarts= [SERIAL] maximum number of UARTs to be registered. + ntlb= [MIPS] Override max number of TLB entries. + numa=off [KNL, ARM64, PPC, RISCV, SPARC, X86] Disable NUMA, Only set up a single NUMA node spanning all memory. @@ -5273,6 +5290,18 @@ rcupdate.rcu_self_test= [KNL] Run the RCU early boot self tests + rd_size= [KNL,MIPS] + Specify size of initrd in memory. + Need to be used with rd_start. + + rd_start= [KNL,MIPS] + Specify a virtual address from which to load the initrd. + Must in KSEG0 or XKPHYS space. + Need to be used with rd_size. + + rdhwr_noopt [MIPS] Disable optimization of trap and emulation for + "RDHWR v1, $29" instruction. + rdinit= [KNL] Format: Run specified binary instead of /init from the ramdisk,