Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1048970pxm; Wed, 23 Feb 2022 16:50:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQK8E9hxfIknRF19TKZtU1vpIDjtcqKZ7aaQU86jX9MeS00sV3eCBsV2YNTmvIdvz0xsdK X-Received: by 2002:a63:894a:0:b0:365:8dbf:cd0d with SMTP id v71-20020a63894a000000b003658dbfcd0dmr318976pgd.5.1645663813641; Wed, 23 Feb 2022 16:50:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645663813; cv=none; d=google.com; s=arc-20160816; b=AHKlipEJwzB0LKBjfxkfB6ne5XUhGRY+Bilh2jR9v+R7gSCrS1fZU/j+JeAjl6LRFr BUZ6B7yuhFURJNDCE2rnnPY6r0v7/vP7rHlSW7YJsTF7blKB5s7f3mdXBqKsDeQRb04m eMjuyqRtT4iA7t80T3j2MjADf4aY+WEnbKkMFdpedWXQe+5T45ijN3B9AZ6yPVn1UJWQ cl0IeIjFCaVyXXOydUUrMo1LnanPNZMVZXQGMPhP6NRnhosHJJzrjr+um6RNyLa4E9+a 0TP35JI18big5QO5DnpgW5xzLJOdyE+Z3EZ2qKMI86BLf88ZzsjZMmSLBkpElvXcHKSL 1oHQ== 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=fJkrYZreFrZbT4XmSOKefb8T6OZuObvM4MLsBp/+ydk=; b=xb74yjgMC5+krKbLFCLayI6kOqjIxHZV7zkE4ryghtPSo6lEXoz/fo4GErVKOtxGtH YHdQdYExauXlK22FCkMXjMluXczUtH8L37lC409CbimQOhO2JRXjY07VnD7VwMMBFvtJ 5YFBAoJRdEBNNe+se4rOc/v69/kP5NAfYhu/cn++JVnEwXvujxW8tYEd/eY6udnnvu32 YqE/roOU3qvEGyh2VlkdG9CJ9TQHBPLYFhmjKF6jECEJ716TRDcsz2yzm+8Wk9fLQYh1 0og3miQ8yAyPhwxst73FvhR4sY3cr33dfVro2dUMr3DlzSRLYcE0v2bPWYIgegBzmkDl AJpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=btZLNNKQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l15-20020a17090b078f00b001bc89e59cbdsi3509311pjz.171.2022.02.23.16.50.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 16:50:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=btZLNNKQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BCDB5F5432; Wed, 23 Feb 2022 16:45:18 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240764AbiBWNQ0 (ORCPT + 99 others); Wed, 23 Feb 2022 08:16:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239584AbiBWNQZ (ORCPT ); Wed, 23 Feb 2022 08:16:25 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFE26AA007 for ; Wed, 23 Feb 2022 05:15:55 -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=fJkrYZreFrZbT4XmSOKefb8T6OZuObvM4MLsBp/+ydk=; b=btZLNNKQJthSB3fw2T+zImqCpn meS5pTMkT2JiUCGBD1HwkCyUjBvStmcBuBatMhnHtwhK72lplZHX7P+rBzuLdBBys0W5590kVxWwf zcsBWJEDzX3TRt/4UMeEXGLPnw/i8pYQKpXUBof3gVoFmdHjtwjzNyW9v0gLHDs9M8XddgQHi1Uqq jodL3ltU5pz/aoXLQOIwSkl2Spev+suTlCtP17/b94CNE2CXcMve7c9fCRccqQ7Q0mnaluzJKRyUc pTSfufsugxXf33TXglcR0BcvjwBfrs9Msfr0KjNC2HowPUpv0nN81/VZyDHJTiLFK1C3sQ19pR4tv XciTHApw==; Received: from [189.79.213.38] (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 1nMrUK-0000VM-AI; Wed, 23 Feb 2022 14:15:24 +0100 Message-ID: <5eeba935-d73a-5539-4eb1-298fb6ee0578@igalia.com> Date: Wed, 23 Feb 2022 10:15:05 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH V6] panic: Move panic_print before kmsg dumpers Content-Language: en-US To: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, bhe@redhat.com, pmladek@suse.com, akpm@linux-foundation.org, anton@enomsg.org, ccross@android.com, dyoung@redhat.com, feng.tang@intel.com, john.ogness@linutronix.de, keescook@chromium.org, kernel@gpiccoli.net, kexec@lists.infradead.org, rostedt@goodmis.org, tony.luck@intel.com, vgoyal@redhat.com References: <20220214141308.841525-1-gpiccoli@igalia.com> <7e15bc6a-ceae-aa3a-0a86-18d24181b0ed@igalia.com> From: "Guilherme G. Piccoli" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 22/02/2022 22:27, Sergey Senozhatsky wrote: > [...] > Hmm. Yeah, well, that's a bit of a tricky interface now > > panic() > // everything (if corresponding bits set), no console flush > panic_print_sys_info(false) > ... > // console flush only if corresponding bit set > panic_print_sys_info(true) > > > > If everyone is fine then OK. > > But I _personally_ would look into changing this to something like this: > > #define EARLY_PANIC_MASK (PANIC_PRINT_FOO | PANIC_PRINT_BAR | ...) > #define LATE_PANIC_MASK (PANIC_PRINT_ALL_PRINTK_MSG) > panic() > panic_print_sys_info(panic_print & EARLY_PANIC_MASK) > ... > panic_print_sys_info(panic_print & LATE_PANIC_MASK) Hi Sergey, notice that panic_print_sys_info() currently doesn't have a parameter! The prototype (without this patch) is: static void panic_print_sys_info(void); So, it consumes the "panic_print" global variable (which matches the command-line parameter / sysctl), hence to implement your suggestion either we need a refactor in panic_print_sys_info(), adding a parameter (more or less what the patch is already doing, but with a bit more changes) or we override the global variable twice in panic(), before the function calls. As you said, it's possible and a matter of personal coding style. I'd be fine if more people ask that, but if everyone is fine with the current implementation, I'd rather get this patch merged as is, since we need it and couldn't even make it for 5.17 heh Cheers, Guilherme