Message ID | 20221107141638.3790965-10-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2078725wru; Mon, 7 Nov 2022 06:21:02 -0800 (PST) X-Google-Smtp-Source: AMsMyM4CiUxKIJpIwEQUqYXjZKnQNVGTL/bJOfleR78KrVhvujXoijRJTPK3wfRNY9dZdcxrsM+g X-Received: by 2002:a05:6402:51ca:b0:462:273b:6ad6 with SMTP id r10-20020a05640251ca00b00462273b6ad6mr35536283edd.119.1667830862477; Mon, 07 Nov 2022 06:21:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830862; cv=none; d=google.com; s=arc-20160816; b=YLYkGmQVSbhXX3rbTyzYa/SFrN7yUgF/GMKsImKTqsrXe3Tkrf8ToA7JDHWP/7l324 gNc8Qksr9mG6jlOHHvZ7jSGxgYwnehl89BQWXjEnptfFeilqleE58dnTHwbsMQ9KDO46 TilVq8BWgPGdh1j7zXzwHyUTdFKp//R6c4y7zJM6acpGJ8sa6WouxtPmomB+jKxFvbLj EIsC26yL+mG2QXyEiCv2RkkklMoZUaey5wsXVwqzsY53AcQgLPHB9LsIV12ohh4IL4Ic oMkzYQ43EA1hX3BMf6fuGqgHL5yV5txwb5KOWHHiS1T6KlGPRofHuo95ao51PuH+j4Ql S1Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=je6BJxg9zIGvpozBTcqdrPDtOdfb/xlqXdr2RuFn3Cs=; b=jrVNrZUKdjm0vUu7Dvhcp6QmJ3I0msgEqeVBpQNaB9dKZZN7B2tV8bn+OS5CVRldsw mE4GQy73MYW6ah3pAC3ZioljSzclpPDgC0H/JljcanE4KBw7zASjkMKVQs5oL8P3z0ll rMfVT45P3L+27V4Hx5sv8T3HeD4rDHdg1e9kUuRpuqn9Kg9O+baa+qmQXHxnpj2f/mmM efJyjiGM+yBlzf4pCvqkxzJLUYMGNKF1kIvzmtrhrbryX9Qi6lAmuczZ7uhTPUYweJ2X HZ5Zrekh/0fPmw8GVDEDUKMGeTBBNEYdfX7SDuggErHtK5EC9AwCumN6BWMNvF5WFvrS PrjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xStyNuRD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=fU3tEDpT; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc18-20020a1709071c1200b00797e151e571si10907306ejc.36.2022.11.07.06.20.34; Mon, 07 Nov 2022 06:21:02 -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=pass header.i=@linutronix.de header.s=2020 header.b=xStyNuRD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=fU3tEDpT; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232319AbiKGOSB (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 09:18:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232117AbiKGOQq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 09:16:46 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E51B01D0E5 for <linux-kernel@vger.kernel.org>; Mon, 7 Nov 2022 06:16:45 -0800 (PST) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=je6BJxg9zIGvpozBTcqdrPDtOdfb/xlqXdr2RuFn3Cs=; b=xStyNuRDwQZqAStcI5UdpJk/G1E5RxVmu6uOQl+HxB1LsyG+UGrqEo1GBdH5tNIsVYbp31 0sGdsUMWqMJ/RIw/dqRua8mTPCiC2Bi6yXAUtwiWaId98XBGkDmKHPA2T1r7BIup48ey9t V9t+le50KAGrPTn4fCw91P4Os0mVXzm0RBzuzyUZYvXZ4/TFQS0VlpLfWhhNciYokn7bY0 x6OS3kQVIDIkRsGimBU+tA3J0nxK/4cLvsdYUYYb7XEy3sJM89hJF40SlQ4jDenQhvJNj1 T4y6vF+anyQgoWACwNMjdC5+tAh9Q1X1KynBM24kz9ifzeNZquHauzk0EDw2rQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=je6BJxg9zIGvpozBTcqdrPDtOdfb/xlqXdr2RuFn3Cs=; b=fU3tEDpTAS3rUjjLodJQU8W30Uff0X7RCSHHMp6eNmbUMCNdxpTq68atryVxFBzRoHmaAA LJxSkx1rw4wUSjBA== To: Petr Mladek <pmladek@suse.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org, Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, linux-um@lists.infradead.org Subject: [PATCH printk v3 09/40] um: kmsg_dump: use console_is_enabled() Date: Mon, 7 Nov 2022 15:22:07 +0106 Message-Id: <20221107141638.3790965-10-john.ogness@linutronix.de> In-Reply-To: <20221107141638.3790965-1-john.ogness@linutronix.de> References: <20221107141638.3790965-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748847414478152884?= X-GMAIL-MSGID: =?utf-8?q?1748847414478152884?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Nov. 7, 2022, 2:16 p.m. UTC
Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
arch/um/kernel/kmsg_dump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon 2022-11-07 15:22:07, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness <john.ogness@linutronix.de> > --- > arch/um/kernel/kmsg_dump.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c > index 40abf1e9ccb1..f0233e2f8de0 100644 > --- a/arch/um/kernel/kmsg_dump.c > +++ b/arch/um/kernel/kmsg_dump.c > @@ -32,7 +32,7 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, > * expected to output the crash information. > */ > if (strcmp(con->name, "ttynull") != 0 && > - (con->flags & CON_ENABLED)) { > + console_is_enabled(con)) { The patch does not explain why the racy check is needed here. I would prefer to merge this patch with the patch switching to the srcu console list iterator. It will become more or less self-explaining. Anyway, I agree that the racy check is acceptable here. Best Regards, Petr
On Mon 2022-11-07 15:22:07, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness <john.ogness@linutronix.de> > --- > arch/um/kernel/kmsg_dump.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c > index 40abf1e9ccb1..f0233e2f8de0 100644 > --- a/arch/um/kernel/kmsg_dump.c > +++ b/arch/um/kernel/kmsg_dump.c > @@ -32,7 +32,7 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, > * expected to output the crash information. > */ > if (strcmp(con->name, "ttynull") != 0 && > - (con->flags & CON_ENABLED)) { > + console_is_enabled(con)) { Same as with the 9th patch. I would merge this with the patch switching to the srcu console list iterator. It will explain why the racy check is needed here. This change does not make sense without the other. Best Regards, Petr
On Wed 2022-11-09 15:56:11, Petr Mladek wrote: > On Mon 2022-11-07 15:22:07, John Ogness wrote: > > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > > > Signed-off-by: John Ogness <john.ogness@linutronix.de> > > --- > > arch/um/kernel/kmsg_dump.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c > > index 40abf1e9ccb1..f0233e2f8de0 100644 > > --- a/arch/um/kernel/kmsg_dump.c > > +++ b/arch/um/kernel/kmsg_dump.c > > @@ -32,7 +32,7 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, > > * expected to output the crash information. > > */ > > if (strcmp(con->name, "ttynull") != 0 && > > - (con->flags & CON_ENABLED)) { > > + console_is_enabled(con)) { > > Same as with the 9th patch. I would merge this with the patch > switching to the srcu console list iterator. It will explain > why the racy check is needed here. This change does not make > sense without the other. Ah, this was supposed to be for the 10th patch. I am sorry for confusion. Best Regards, Petr
diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c index 40abf1e9ccb1..f0233e2f8de0 100644 --- a/arch/um/kernel/kmsg_dump.c +++ b/arch/um/kernel/kmsg_dump.c @@ -32,7 +32,7 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, * expected to output the crash information. */ if (strcmp(con->name, "ttynull") != 0 && - (con->flags & CON_ENABLED)) { + console_is_enabled(con)) { break; } }