Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2512735pxb; Sun, 23 Jan 2022 07:05:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPwZAB/9QdMxnSsKyzMvX9lNVPdCwWtuO90ZmdwLb1yNdKdvNBCVQ3l1U9ZHWk4FvZuwzf X-Received: by 2002:a17:90b:4b42:: with SMTP id mi2mr9214200pjb.243.1642950300301; Sun, 23 Jan 2022 07:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642950300; cv=none; d=google.com; s=arc-20160816; b=GdiDgEe/fOBTb/xTRN30AZAbHx5dFnJ1/tUwO3sV7rMoPeA9R1mIXIbjOzFgGChXKb XPIvQ0eil8aeU4wrKgOS66UMiNfK7+P1aEf91soOEWsvRI3rU81jhhV3kQsXffWk+Ol9 DFg904o/Z6Qq0MnwVm3lg4fuOmFv/qhUou8Xd13Poc9ji+dBfpdQVJ3dzFtejL0kJN3x 81z37egRfTLZGZOUMiI9qVSJKIVDsK6/30brgroTXd1BAVos2HYcW6QALr8yvdIBqFjS XgFIzilODMpfrVFcBzO9uH5XOUfPlUcp0TyDK0kCDw2BRggoiMD2MYCJCrBfWTPc1Hmd zSlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=S/aKIEWGP20c/FB8xyA/aRtZKWYn2S9+h6FmEWLndug=; b=T/pDofCUqK1O9t8BzK0Cjh2F5WDC5VlqB6i8Y+KnWIR4nZbO014RlBnufKn4cr0H7w cl3jDIAUFlrOIEntItFBYT6lpZfSXe6uqJ3V2b6m+/xWwm5+nGtgTYNwvIsldvEzovLT 1E9k/LxjqkR/tJE9PWsgM9+os9jn+JcSQUpP+VnM4oqMPsFFc7zwsN3CxOGqeD1X14hQ kYZyuecm6kt/2phNAaz35WYMGLlZGMGmKg+PpIn66odRxGCabZ0wqU6uFnfZF7rQOm3J mqfB1TyqKTiCJl4DY0KZP/JuYbWLTXBwmgEQjw4ENSvFgNR0WUB71HpAFetgNEmHwq9y tBlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fzwil8o7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si11555537pgr.187.2022.01.23.07.04.46; Sun, 23 Jan 2022 07:05:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fzwil8o7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233926AbiAVKz0 (ORCPT + 99 others); Sat, 22 Jan 2022 05:55:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23923 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232530AbiAVKzZ (ORCPT ); Sat, 22 Jan 2022 05:55:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642848924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=S/aKIEWGP20c/FB8xyA/aRtZKWYn2S9+h6FmEWLndug=; b=fzwil8o7xoy3WfykIm9v8LlwDmmHvXt5YpdYVE+WqtGw2qOMe2NR+X5H3H0+qH5XYz2fWV 0M+Y7tZADVB+Cc7EIANY5uu0v2nIvGjoDiOzftDiDDljyiRNCpCXd9W5aILWLpvcEJg6+5 hsQHnLSAu68C1ufOu0mrKW9QtpAw864= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-630-QYK4v5prPBi61kryn1pFCA-1; Sat, 22 Jan 2022 05:55:20 -0500 X-MC-Unique: QYK4v5prPBi61kryn1pFCA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D5BBE1006AA4; Sat, 22 Jan 2022 10:55:17 +0000 (UTC) Received: from localhost (ovpn-12-78.pek2.redhat.com [10.72.12.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 655A3752CE; Sat, 22 Jan 2022 10:55:16 +0000 (UTC) Date: Sat, 22 Jan 2022 18:55:14 +0800 From: Baoquan He To: "Guilherme G. Piccoli" , Masami Hiramatsu , HATAYAMA Daisuke Cc: Petr Mladek , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, dyoung@redhat.com, linux-doc@vger.kernel.org, vgoyal@redhat.com, stern@rowland.harvard.edu, akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, corbet@lwn.net, halves@canonical.com, kernel@gpiccoli.net, Will Deacon , Kees Cook , Steven Rostedt , Hidehiro Kawai , Vitaly Kuznetsov , John Ogness , "Paul E. McKenney" , Peter Zijlstra , Juergen Gross , mikelley@microsoft.com Subject: Re: [PATCH V4] notifier/panic: Introduce panic_notifier_filter Message-ID: <20220122105514.GA18258@MiWiFi-R3L-srv> References: <20220108153451.195121-1-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/21/22 at 05:31pm, Guilherme G. Piccoli wrote: ...... > > IMHO, the right solution is to split the callbacks into 2 or more > > notifier list. Then we might rework panic() to do: > > > > void panic(void) > > { > > [...] > > > > /* stop watchdogs + extra info */ > > atomic_notifier_call_chain(&panic_disable_watchdogs_notifier_list, 0, buf); > > atomic_notifier_call_chain(&panic_info_notifier_list, 0, buf); > > panic_print_sys_info(); > > > > /* crash_kexec + kmsg_dump in configurable order */ > > if (!_crash_kexec_post_kmsg_dump) { > > __crash_kexec(NULL); > > smp_send_stop(); > > } else { > > crash_smp_send_stop(); > > } > > > > kmsg_dump(); > > if (_crash_kexec_post_kmsg_dump) > > __crash_kexec(NULL); > > > > /* infinite loop or reboot */ > > atomic_notifier_call_chain(&panic_hypervisor_notifier_list, 0, buf); > > atomic_notifier_call_chain(&panic_rest_notifier_list, 0, buf); > > > > console_flush_on_panic(CONSOLE_FLUSH_PENDING); > > [...] > > Two notifier lists might be enough in the above scenario. I would call > > them: > > > > panic_pre_dump_notifier_list > > panic_post_dump_notifier_list > > > > > > It is a real solution that will help everyone. It is more complicated now > > but it will makes things much easier in the long term. And it might be done > > step by step: > > > > 1. introduce the two notifier lists > > 2. convert all users: one by one > > 3. remove the original notifier list when there is no user > > That's a great idea! I'm into it, if we have a consensus. The thing that > scares me most here is that this is a big change and consumes time to > implement - I'd not risk such time if somebody is really against that. > So, let's see more opinions, maybe the kdump maintainers have good input. I am fine with it. As long as thing is made clear, glad to see code is refactored to be more understandable and improved. Earlier, during several rounds of discussion between you and Petr, seveal pitfalls have been pointed out and avoided. Meanwhile, I would suggest Masa and HATAYAMA to help give input about panic_notifier usage and refactory. AFAIK, they contributed code and use panic_notifier in their product or environment a lot, that will be very helpful to get the first hand information from them. Hi Masa, HATAYANA, Any comment on this? (Please ignore this if it's not in your care.)