Received: by 2002:ac8:71d8:0:b0:40f:fb00:664b with SMTP id i24csp199268qtp; Fri, 4 Aug 2023 08:24:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHuMuUuz+WvHzni56/h+TajdYrKRSKL9mVEC4ilMCGLERighfF6MJVMKxNNqDM2+mQkLkag X-Received: by 2002:a17:902:b283:b0:1b5:1787:d23f with SMTP id u3-20020a170902b28300b001b51787d23fmr1728072plr.5.1691162648217; Fri, 04 Aug 2023 08:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691162648; cv=none; d=google.com; s=arc-20160816; b=SLIqLWQ7xLxmo7hpUlk6qacAlr7yoDseIDNRSnOMZtORwmSBlzTbOcd4zjPjQEs+y+ SJWMCy5XPhrcXvAWQyb521vBCu25wNdrZt1GvN8sK3RsAp02UesxJ9VdNzFj3SQ941ds EabZNSLJOdgdKVnRIeyXI1bb5yevYm+z8yE4J7Qq7+XJqlyX+VY4IgnxTH7RUy6nZZez ExYcZXBgU0/13+hDeenYSWKZLITxABn2yRHyyB65Y6H43tTYeH7ftv5GKxA4eBdOSwLV AyYxdvzYa9ikWMB28ydV21I4TIOwP9p5KoueB9CKPB0E2THfZr5+drGG3H+QP6hrgLkK pjDg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VNWjSzFu/PyMqv6O223Z6nS9JKkdr9V4bRYfAQix7nk=; fh=jzbHHzAryLHkQMLdi2qZOpSkKgHZoU03pairMFvFFNE=; b=C/paWDSotGaKuLDIZZZLynjobPrru+56/RQ65gNu5/QVcqFQclhP9c+s0Ja2n11a7d OVUNY77xGbxHo9otMpmn/xcVI409uV9wCnbK8IvDAXuB9AbnGcsnWvFQrWWfDuSSGBSW OL8Ho+AmPpqLX16tsM5rFCXYpKjjNBKg4jRzM1MkJQ0NiEFaMS69jC+kWS41Q7O9kyY6 0CGmcy57KM8qI6VjZ7RHzBqxoKSQNm15H+AT0UnvlKfOw3Ye+kDg/IvIJBi8qH0h8xxZ kq0a9DwfnCqllSQ8vqMTe2SOmT8j4zKl+Bvc4OG+O/5M/HSQDat9AFbp4kIDnh/yfCYG PcOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=lk1XMNHd; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020a170902654500b001b682a513desi1901918pln.400.2023.08.04.08.23.48; Fri, 04 Aug 2023 08:24:08 -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=@suse.com header.s=susede1 header.b=lk1XMNHd; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231889AbjHDPCg (ORCPT + 99 others); Fri, 4 Aug 2023 11:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231888AbjHDPCa (ORCPT ); Fri, 4 Aug 2023 11:02:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B284C0C; Fri, 4 Aug 2023 08:02:16 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E6C0921888; Fri, 4 Aug 2023 15:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1691161334; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VNWjSzFu/PyMqv6O223Z6nS9JKkdr9V4bRYfAQix7nk=; b=lk1XMNHdUBmmPgv2SbCy1HPgNADs5W9jPaKQk5f95D0ji/Kgs8ioTEuIp8biBXwjs1qmZ1 DiFaVY7HQOUrW/Ni/kuVUUuHlF9fOwxllYFqY0tab1QiufzfgVh4ZneVj/CAfbnw8UZCx8 C9Flw2p3O6/4ZMw5+YhH870Kk2vgfAg= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B586B133B5; Fri, 4 Aug 2023 15:02:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id o4i3K/YSzWSpRwAAMHmgww (envelope-from ); Fri, 04 Aug 2023 15:02:14 +0000 Date: Fri, 4 Aug 2023 17:02:14 +0200 From: Michal Hocko To: Doug Anderson Cc: Andrew Morton , Petr Mladek , Arnd Bergmann , Borislav Petkov , Christophe Leroy , "Darrick J. Wong" , Dave Hansen , "David S. Miller" , Gaosheng Cui , "Gautham R. Shenoy" , Greg Kroah-Hartman , "Guilherme G. Piccoli" , Guo Ren , "H. Peter Anvin" , Huacai Chen , Ingo Molnar , "Jason A. Donenfeld" , Jianmin Lv , Jinyang He , Josh Poimboeuf , Kees Cook , Lecopzer Chen , Marc Zyngier , Mark Rutland , Michael Ellerman , Nicholas Piggin , "Paul E. McKenney" , Peter Zijlstra , Pingfan Liu , Qing Zhang , "Rafael J. Wysocki" , Russell King , Stephen Rothwell , Thomas Bogendoerfer , Thomas Gleixner , Tom Rix , Ulf Hansson , Valentin Schneider , WANG Xuerui , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v3 1/2] nmi_backtrace: Allow excluding an arbitrary CPU Message-ID: References: <20230803160649.v3.1.Ia35521b91fc781368945161d7b28538f9996c182@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,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 Fri 04-08-23 06:56:51, Doug Anderson wrote: > Hi, > > On Fri, Aug 4, 2023 at 12:50 AM Michal Hocko wrote: > > > > On Thu 03-08-23 16:07:57, Douglas Anderson wrote: > > > The APIs that allow backtracing across CPUs have always had a way to > > > exclude the current CPU. This convenience means callers didn't need to > > > find a place to allocate a CPU mask just to handle the common case. > > > > > > Let's extend the API to take a CPU ID to exclude instead of just a > > > boolean. This isn't any more complex for the API to handle and allows > > > the hardlockup detector to exclude a different CPU (the one it already > > > did a trace for) without needing to find space for a CPU mask. > > > > > > Arguably, this new API also encourages safer behavior. Specifically if > > > the caller wants to avoid tracing the current CPU (maybe because they > > > already traced the current CPU) this makes it more obvious to the > > > caller that they need to make sure that the current CPU ID can't > > > change. > > > > Yes, this looks like the best way forward. > > > > It would have been slightly safer to modify arch_trigger_cpumask_backtrace > > by switching arguments so that some leftovers are captured easier. > > I'm not sure I understand. Oh, you're saying make the prototype of > arch_trigger_cpumask_backtrace() incompatible so that if someone is > directly calling it then it'll be a compile-time error? exactly. bool to int promotion would be too easy to miss while the pointer to int would complain loudly. > I guess the > hope is that nobody is calling that directly and they're calling > through the trigger_...() functions. Hope is one thing, being preventive another. > For now I'm going to leave this alone. If you are going to send another version then please consider this. Not a hard requirement but better. -- Michal Hocko SUSE Labs