From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5B78C001DE for ; Mon, 7 Aug 2023 07:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjHGHDv (ORCPT ); Mon, 7 Aug 2023 03:03:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjHGHDs (ORCPT ); Mon, 7 Aug 2023 03:03:48 -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 86E9010D4; Mon, 7 Aug 2023 00:03:46 -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 6CB1C2189B; Mon, 7 Aug 2023 07:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1691391824; 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=qBVvdfQ+7uAuAbXARcqoglYVEWjC2ubdJ2O+ToyhcnU=; b=SpNvqN9W8w6c37IfcNk3eNCCy+0l0bY2sLCvSbaXXbOq+nOiCcs5cLMdA3n9BIlH9vi8jv 8ByLlL96TK8WiF7qhIOzvIwWLjdpbTOwSIgsMSMdc2Zhix/B3WxC9HUozdEXzDUtH3HOia ikj4S2h/luSXV1azSnZY+DCjxmABQiQ= 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 43F6D13910; Mon, 7 Aug 2023 07:03:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2asJEFCX0GQwWAAAMHmgww (envelope-from ); Mon, 07 Aug 2023 07:03:44 +0000 Date: Mon, 7 Aug 2023 09:03:43 +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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 04-08-23 09:06:07, Doug Anderson wrote: > Hi, > > On Fri, Aug 4, 2023 at 8:02 AM Michal Hocko wrote: > > > > > > 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. > > If I do send another version, do you have any suggestions for how to > change this to make it incompatible? I would swap parameters as this seems simplest. > I guess swapping the order of the > parameters would be best? I considered doing that for v4 but I felt > like long term the current order of the parameters was better. Yes the current ordering is better but having it other way around is not really horrendous either. > I also > considered a rename, but that different problems. ;-) If I rename both > the #define and the function then if someone has an out-of-tree patch > adding arch_trigger_cpumask_backtrace() for another architecture, like > say arm64, then there would be no compile-time failure indicating that > the out-of-tree patch needs updating. I could rename the functions but > _not_ the #define, I guess? I think that swapping would be simplest as the type mismatch should catch also pending out-of-tree potential implementations. -- Michal Hocko SUSE Labs