Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6146626iog; Thu, 23 Jun 2022 12:18:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkE7f5smm1jGtnkyPjeMZTly0XlU2oFfk2V1rY4l8M+xhGTqNxdiTplmlIBYQccyJc3i6z X-Received: by 2002:a17:90b:3842:b0:1ed:16aa:def6 with SMTP id nl2-20020a17090b384200b001ed16aadef6mr2662859pjb.130.1656011903790; Thu, 23 Jun 2022 12:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011903; cv=none; d=google.com; s=arc-20160816; b=aKm17yzXKeM0YW1Xzf9uNJBzk17wE7ovniTJ9QfVRVkPOh78YK4x1h7WCk5zQA2LDb B94ajYWnT2Ck+sUGoBiGGsqarTWgZBiqJGwceSjrLklZ0WKioklGD8rXcBBVas+LGi0e oDt9IujePTuM1r39UJf5yRW5HPZ7/7hjN7xFrcwzyybMzDDI9/g7zzIhQ4QEEI3MqAEn eC6sFAAcNKfRMpqLiFr9IzwU9NwPbABgVsGUYHuFgYNjnZhNeLt0Z1yNuRFMFUQStPea 2mL2aYadHKoyta2cnFk5EulJM3huKfkIs1dH2NTIiWh0Z/+cEmzJZjhudEzNaIh9dou5 dGig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=6OXl8nU3O0vsUUAHgJeBUoHNx37icdPhV3yLsSJhBsc=; b=ZZr14TibjC1DV/S9wFkPbgTtAU5cY6AZyKzrVBdmwoSWjBETpeJlltph30Wdd+SA1X QnTcnqLZTVUbH4FIihcylxFvIWaIWYA1AKiVM4fEiXdzYh24d4CqNKgp389DhikHMizF lvMnumBjcA0IlXO5GipiG/SSd+SLLJt8t9JVbH22Eot801x+USoUkojIJQ+9vjw63QD7 Ao14M2Egn0X0TBujcGjwUFnU914eHsdU4JoObk1EH4UyWrFhyugmhzxroYaIMANBrZTE WrW7dJyjAMgqEsRguMdRyNGP5DGhC4AbHuL99DmKoJjnzI7OZlNIlbz3bp6nxJ/gq9Az Fxbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Y3TA0mqg; 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=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cj18-20020a056a00299200b00522c3a00ee9si26474353pfb.270.2022.06.23.12.18.11; Thu, 23 Jun 2022 12:18:23 -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=@ibm.com header.s=pp1 header.b=Y3TA0mqg; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232490AbiFWS2z (ORCPT + 99 others); Thu, 23 Jun 2022 14:28:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234588AbiFWS1D (ORCPT ); Thu, 23 Jun 2022 14:27:03 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB86F50B0C for ; Thu, 23 Jun 2022 10:28:56 -0700 (PDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25NH477J005821; Thu, 23 Jun 2022 17:28:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type; s=pp1; bh=6OXl8nU3O0vsUUAHgJeBUoHNx37icdPhV3yLsSJhBsc=; b=Y3TA0mqgqSgd3CMi4ogddbNhPuhnxTaec8Vqyi9b/zcgWwAAMH+YcJA70VNHvCFGIiQN zR24VWmejEg/nI2tsC/OF1lcu123dFSKvIKHIbhdqHv2P+ExDf8QUM4whfD01WYA+aCR VZzufpxJkUnny3e8QJnownQFe8GW1Z210WiM21twHIas6/ubfst4vAlGMKqwtiIuNKVv LgVz+I5tGmGWfsd0MociXvBTL1/2y3m71f7CQAYm8Hv+MclFSw/nq5Ilr0gPvo1Lr3fb k/OLV/g+iYVOCU5nnn/FSNOuUF7ulqwMPtSUWS/FRJE320d/A0ZSmr97xfojlH1bCYaU RQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gvux4srfn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jun 2022 17:28:37 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 25NGgZhI019666; Thu, 23 Jun 2022 17:28:37 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gvux4srf1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jun 2022 17:28:36 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25NHKRpA001613; Thu, 23 Jun 2022 17:28:35 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01dal.us.ibm.com with ESMTP id 3guk92nqty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jun 2022 17:28:35 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25NHSYCt33161502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jun 2022 17:28:34 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F949136059; Thu, 23 Jun 2022 17:28:34 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5EB9F13605D; Thu, 23 Jun 2022 17:28:34 +0000 (GMT) Received: from localhost (unknown [9.211.80.5]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 23 Jun 2022 17:28:34 +0000 (GMT) From: Nathan Lynch To: Laurent Dufour Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, haren@linux.vnet.ibm.com, npiggin@gmail.com Subject: Re: [PATCH v2 4/4] pseries/mobility: Set NMI watchdog factor during LPM In-Reply-To: <20220614135414.37746-5-ldufour@linux.ibm.com> References: <20220614135414.37746-1-ldufour@linux.ibm.com> <20220614135414.37746-5-ldufour@linux.ibm.com> Date: Thu, 23 Jun 2022 12:28:34 -0500 Message-ID: <87sfnvmgql.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-GUID: REn_lZoZMpAj12V61_21I2CQkeWkN_5s X-Proofpoint-ORIG-GUID: Kp3KJByhFMvM2McxSTK861NMN4gk17Zz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-23_07,2022-06-23_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 mlxlogscore=972 priorityscore=1501 phishscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206230067 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 Laurent Dufour writes: > diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c > index 179bbd4ae881..4284ceaf9060 100644 > --- a/arch/powerpc/platforms/pseries/mobility.c > +++ b/arch/powerpc/platforms/pseries/mobility.c > @@ -48,6 +48,39 @@ struct update_props_workarea { > #define MIGRATION_SCOPE (1) > #define PRRN_SCOPE -2 > > +#ifdef CONFIG_PPC_WATCHDOG > +static unsigned int lpm_nmi_wd_factor = 200; > + > +#ifdef CONFIG_SYSCTL > +static struct ctl_table lpm_nmi_wd_factor_ctl_table[] = { > + { > + .procname = "lpm_nmi_watchdog_factor", Assuming the basic idea is acceptable, I suggest making the user-visible name more generic (e.g. "nmi_watchdog_factor") in case it makes sense to apply this to other contexts in the future. > + .data = &lpm_nmi_wd_factor, > + .maxlen = sizeof(int), > + .mode = 0644, > + .proc_handler = proc_douintvec_minmax, > + }, > + {} > +}; > +static struct ctl_table lpm_nmi_wd_factor_sysctl_root[] = { > + { > + .procname = "kernel", > + .mode = 0555, > + .child = lpm_nmi_wd_factor_ctl_table, > + }, > + {} > +}; > + > +static int __init register_lpm_nmi_wd_factor_sysctl(void) > +{ > + register_sysctl_table(lpm_nmi_wd_factor_sysctl_root); > + > + return 0; > +} > +device_initcall(register_lpm_nmi_wd_factor_sysctl); > +#endif /* CONFIG_SYSCTL */ > +#endif /* CONFIG_PPC_WATCHDOG */ > + > static int mobility_rtas_call(int token, char *buf, s32 scope) > { > int rc; > @@ -702,6 +735,7 @@ static int pseries_suspend(u64 handle) > static int pseries_migrate_partition(u64 handle) > { > int ret; > + unsigned int factor = lpm_nmi_wd_factor; > > ret = wait_for_vasi_session_suspending(handle); > if (ret) > @@ -709,6 +743,13 @@ static int pseries_migrate_partition(u64 handle) > > vas_migration_handler(VAS_SUSPEND); > > +#ifdef CONFIG_PPC_WATCHDOG > + if (factor) { > + pr_info("Set the NMI watchdog factor to %u%%\n", factor); > + watchdog_nmi_set_lpm_factor(factor); > + } > +#endif /* CONFIG_PPC_WATCHDOG */ > + > ret = pseries_suspend(handle); > if (ret == 0) { > post_mobility_fixup(); > @@ -716,6 +757,13 @@ static int pseries_migrate_partition(u64 handle) > } else > pseries_cancel_migration(handle, ret); > > +#ifdef CONFIG_PPC_WATCHDOG > + if (factor) { > + pr_info("Restoring NMI watchdog timer\n"); > + watchdog_nmi_set_lpm_factor(0); > + } > +#endif /* CONFIG_PPC_WATCHDOG */ > + A couple more suggestions: * Move the prints into a single statement in watchdog_nmi_set_lpm_factor(). * Add no-op versions of watchdog_nmi_set_lpm_factor for !CONFIG_PPC_WATCHDOG so we can minimize the #ifdef here. Otherwise this looks fine to me.