Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3158175rwb; Sun, 20 Nov 2022 08:19:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hLxCQDGBevIwwSAp5oJTUBQRQS+EqV3/F/kXG2kDqk4RinDdzyo+QsWBo2Wy1+tEcZWLT X-Received: by 2002:a17:906:dfc1:b0:78d:894d:e123 with SMTP id jt1-20020a170906dfc100b0078d894de123mr12534069ejc.112.1668961148835; Sun, 20 Nov 2022 08:19:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668961148; cv=none; d=google.com; s=arc-20160816; b=d2ZDigNvwrw5XMegr0H2CCVMoAbr61a7RiGzUAxEw+kktWwfoJ3JQlLPzJw6h9E0s0 rQKOVYpvKYaP6Sh1OQusxwuxf1E+M2V4Wa2uVZCQ/RSHaVSuI0MWrySITjJUtBG2sltX B4p131LaBL0hzC2K7+2K2BabUsZkpJMSHgpQGnDDXsWXWFu19C2SPq9aYufEFxzCcMjW zibrbOR1heX4OoR7Q/nQuuk+G0L5afG7H1Jg/wRVMgN9po1XpgfdpBZpVN69JHiLp/DF tCS0egpROT8KYbXux1Of3pUqvH+O15xt+M6QBH8OxDPIg2hAQ3NNVFwbTnW++F1vY8Hp PSGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=e5V74uO+lPGfLCVFC2OTvdyO/WcjexhhijVYs6KZ/ac=; b=afdzNixmz9Lz234DAxhUSMxEElEnRe+WfpM3R8qq1JFYYq5ejSrg/bICR1SGJeTlCN afSsw7ANqsl953ni+O4POVfxXwYIhL+48NSwNtQtdKtw27Hn0cBc5sgpnWTo80wrE/hp wr3aZHSMvIdlJFShB0mY0056y1oE3iOoDZlBjG6tyRwWsdv+LgKdFJ6axkQI5qTQddCb Idas4LLMWOVJulb4bhI9k2pPYVy0zhH6BBhDc7Q6HLRahCmf/Afjmu4AK40KbkNRVjBa SQlWqRRqXmxO0xqTEQh5/NJzVDvHzQh4NRqO348yavrZmhgBJjCRf2Fl71kiBiJ7jxIu 3/yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=YbE1m9+H; 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 ds3-20020a0564021cc300b0045961c7dde9si4217807edb.63.2022.11.20.08.18.43; Sun, 20 Nov 2022 08:19:08 -0800 (PST) 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=fail header.i=@igalia.com header.s=20170329 header.b=YbE1m9+H; 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 S229702AbiKTPmR (ORCPT + 92 others); Sun, 20 Nov 2022 10:42:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiKTPmP (ORCPT ); Sun, 20 Nov 2022 10:42:15 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED9CE13E1F for ; Sun, 20 Nov 2022 07:42:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=e5V74uO+lPGfLCVFC2OTvdyO/WcjexhhijVYs6KZ/ac=; b=YbE1m9+HYuxGK6UZiyQSXJmrLi bQz83Gb3RcS7uKmB69PXmPfhW616XS0jWppEgsMk6MG0+nO941NkKZZ891mr1G789zmSwLB3/DfE7 fOa33qk7AOKuC4Azj53lwAlGwCsevTq36i20RIFCfuesn39Pjvv/vTkLtRfU9xJVgqD5W1ahSakqS MFSfnlBppi0pzfm7GH1WTiLMcYWMJSCCOJKdpbHbE+R75TOBt20d5GQV++0/wcqeic2JiZ1ELER3f Wqffh5HurP405r59qlmZQ7Xn/IcqFNIPRf5mSM3loCnGh2ddBZYUNGclf6iMd5HleslsSt7oB71RD 1qpjXHbw==; Received: from [177.102.6.147] (helo=[192.168.1.60]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1owmRn-005Gz5-HU; Sun, 20 Nov 2022 16:41:31 +0100 Message-ID: <08ea8a0f-f7b2-911f-1efa-2aa8fa04256d@igalia.com> Date: Sun, 20 Nov 2022 12:41:21 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH RESEND] panic: Add register_panic_notifier and unregister_panic_notifier Content-Language: en-US To: Xu Qiang Cc: daniel.vetter@ffwll.ch, andriy.shevchenko@linux.intel.com, elver@google.com, tangmeng@uniontech.com, bigeasy@linutronix.de, pmladek@suse.com, mcgrof@kernel.org, akpm@linux-foundation.org, john.ogness@linutronix.de, yangtiezhu@loongson.cn, linux-kernel@vger.kernel.org, weiyongjun1@huawei.com References: <20221119080305.111863-1-xuqiang36@huawei.com> From: "Guilherme G. Piccoli" In-Reply-To: <20221119080305.111863-1-xuqiang36@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS 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 19/11/2022 05:03, Xu Qiang wrote: > Add two methods to manipulate panic_notifier_list and export them. > Subsequently, panic_notifier_list is changed to static variable. > > Signed-off-by: Xu Qiang > --- > include/linux/panic_notifier.h | 3 +++ > kernel/panic.c | 12 ++++++++++++ > 2 files changed, 15 insertions(+) > Hi Xu Qiang, thanks for your patch! Did you manage to change all users in the kernel? I only received this email that introduces the helpers, but I don't see them getting used in code... Also, did you follow [0]? I stopped a bit this work since the main reviewers got busy in other stuff (so did I), but I intend to resume that and submit a new version. With that said, these helpers you're adding now will eventually require to be all replaced if my work reach a consensus and gets merged..so, personally I don't think it's a necessary addition for now [but don't oppose as well =)] Cheers, Guilherme [0] https://lore.kernel.org/linux-kernel/20220427224924.592546-1-gpiccoli@igalia.com/ > diff --git a/include/linux/panic_notifier.h b/include/linux/panic_notifier.h > index 41e32483d7a7..9543d498b90b 100644 > --- a/include/linux/panic_notifier.h > +++ b/include/linux/panic_notifier.h > @@ -5,6 +5,9 @@ > #include > #include > > +int register_panic_notifier(struct notifier_block *nb); > +int unregister_panic_notifier(struct notifier_block *nb); > + > extern struct atomic_notifier_head panic_notifier_list; > > extern bool crash_kexec_post_notifiers; > diff --git a/kernel/panic.c b/kernel/panic.c > index 75fe389e8814..8f34dbd389cf 100644 > --- a/kernel/panic.c > +++ b/kernel/panic.c > @@ -200,6 +200,18 @@ static void panic_print_sys_info(bool console_flush) > ftrace_dump(DUMP_ALL); > } > > +int register_panic_notifier(struct notifier_block *nb) > +{ > + return atomic_notifier_chain_register(&panic_notifier_list, nb); > +} > +EXPORT_SYMBOL(register_panic_notifier); > + > +int unregister_panic_notifier(struct notifier_block *nb) > +{ > + return atomic_notifier_chain_unregister(&panic_notifier_list, nb); > +} > +EXPORT_SYMBOL(unregister_panic_notifier); > + > /** > * panic - halt the system > * @fmt: The text string to print