Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1768435rwd; Wed, 17 May 2023 00:44:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70hEWnBpW6CjYjFeQoONnPa9v6+Ym0qc+BvsJQW/Ea8PEkeOok/GY8akxREtxAihfmrxLx X-Received: by 2002:a17:902:f545:b0:1ac:3b69:bb9c with SMTP id h5-20020a170902f54500b001ac3b69bb9cmr1522621plf.28.1684309467444; Wed, 17 May 2023 00:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684309467; cv=none; d=google.com; s=arc-20160816; b=pi25k3+NEK1wqrmV7o2cotyRVAG722Q0lHTIln9eDLVDDgHt5nN4McGp+zg4kf7qwx d4YVxPG3JQ1NO/9Y2NBpdT+roBEzB1I57FxvX3l6dHHlwf/zTU1iwsnABvdTQ03wX+EE JRmL7LrVLb18+EM41Lld7kJ3e+kNNrNT0/oBHBpvPCmAzlNwNp/FC7ggtfeElq0tDAuw dW3e1xLWnngZZt+pdvbCakX59HQ5nn60+KslTaYVBmA8/UG6FPe3tP5gh9GcqxyxBHXp 6ashh4Pbb+HqomLBvCVMgNU3614WxWVNTVIDrI1OiSX78aB39O2mj1nMBhY+3sqitGQq OWAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oltwkFLlo0AQrYAodskSSe/CDS+m4jJFdNAkie40kHs=; b=ec89XyByfsy55t2uQNQ1ORI1uMISM3r1BDC/R0+fQyIKTlOrX1+Ve/cdFaHzz0UV8g MsAyyfodJOfPatae3xm/k2uqLa8EHMjBcGv0E4t8gjI14QVkuvDPDq2aJXXqU2swIQWx 1yXGAM5+WZItbVhliEJkx12d+gUQxB9FSJIFyMNfl3DwR2tOEbIqs2uDXzbU4UTRE6j4 gVQ7fOvnPv5SSya0IXGwumVyyqEtC5Lgdg5mzNJOl3M1z4pPIGYFh/qZH84L+DqT8JuZ e6cnTmjzQNoen6QLwx4c80q24vfyC6tUIlsgbDLwR7k0nANKdg6UNwDz/Yx7wt19IY0w sOEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=mxW+jzZA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a170902d4c400b001a0039e3597si21747842plg.316.2023.05.17.00.44.13; Wed, 17 May 2023 00:44:27 -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=@infradead.org header.s=desiato.20200630 header.b=mxW+jzZA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjEQHcE (ORCPT + 99 others); Wed, 17 May 2023 03:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbjEQHb3 (ORCPT ); Wed, 17 May 2023 03:31:29 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BE5E10DA for ; Wed, 17 May 2023 00:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=oltwkFLlo0AQrYAodskSSe/CDS+m4jJFdNAkie40kHs=; b=mxW+jzZAT+OfI3RZ3aJBzvYA36 2r7KbM2Y8CgWd0A+yep/cgiosCLSHyDBQB1vkwFs49tlZPuD9ld+0IwSZAoat0w4OGGcDO7A/NjUH Iy3bx5qWpysvQgyM6weyFOnUpGaSkIQLof96wyzEm1Y2QIxa94opIKsraMJu/7378F9zFUqXUR/3x 8Gn/0FceU5yfAeQ2rbV/DGD6v0CEiz91ynIV2xg9vEoLb1bm7zxqYQqfUl+CM6shcQiED2A3zK2Af YcSj22Q7ksqY3ctXwnmbID3hHwoGhnuv7ZwQaEPn3X0F88eXP7dSFeQSiAeDxah3+SkoY/n97lMmC RpfZtI6g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pzBd3-00D9uS-0O; Wed, 17 May 2023 07:31:21 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0774B3001E4; Wed, 17 May 2023 09:31:20 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E15992419CD6B; Wed, 17 May 2023 09:31:19 +0200 (CEST) Date: Wed, 17 May 2023 09:31:19 +0200 From: Peter Zijlstra To: Song Liu Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, Andrew Morton Subject: Re: [PATCH v2] watchdog: Prefer use "ref-cycles" for NMI watchdog Message-ID: <20230517073119.GA2665450@hirez.programming.kicks-ass.net> References: <20230516235817.2323062-1-song@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230516235817.2323062-1-song@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Tue, May 16, 2023 at 04:58:17PM -0700, Song Liu wrote: > NMI watchdog permanently consumes one hardware counters per CPU on the > system. For systems that use many hardware counters, this causes more > aggressive time multiplexing of perf events. > > OTOH, some CPUs (mostly Intel) support "ref-cycles" event, which is rarely > used. Try use "ref-cycles" for the watchdog, so that one more hardware > counter is available to the user. If the CPU doesn't support "ref-cycles", > fall back to "cycles". > > The downside of this change is that users of "ref-cycles" need to disable > nmi_watchdog. I still utterly hate how you hardcode ref-cycles