Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7255258rwb; Tue, 15 Nov 2022 09:34:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7+SHZcoHJKQZPcOvDYd5WPYeR9FD7qM8S+bABwX5/YiNV7rQCw7cDKI3Ugai5peAe0/pxe X-Received: by 2002:a17:906:6d88:b0:7aa:7c3f:8603 with SMTP id h8-20020a1709066d8800b007aa7c3f8603mr14789698ejt.322.1668533692840; Tue, 15 Nov 2022 09:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668533692; cv=none; d=google.com; s=arc-20160816; b=QlQdI4UkfSEKLQZZzAzVzpJk/siDaIvNpUR1zYW2P4iMO/zzWCyZ4UKHimhUfCYYPq XwYgRLnwS8QKl2R4Mt/LnxJrA5cYpOmUC0wrW2VkzUwlRpnGACYBIMRJOU4VGs4+LPkS X5EXHgcw7qPkigCC5wKquWw85nb9xa6sIZizQd7UIVj1u3/kzCk7QeJxDW9WjhruK+7B rH44uffTqrmmQMHE1z9HJDrgcZxpIq568BAtOCyoOfhlqoU23pNdDjMeVZQRgODsDKIM QiytCtsrP3ZkIuaJBwzpt4gfnVqS9SOO9fuxq33zecIr4N9FSmiQq1Fb1uxK5ATBvg9s 7X/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=Yybjy0PIYNskaP5faHqnthg9WIcdfrQS9ZzYuDsOR40=; b=YMa2zbO3Aoie8Bap7HBiTKk71j5tMRm51MLRHYogFxVWYp6jUCVyBTfX52yfsVX52l MbV/sMRb3ZSjbJSXMwrq2IfbEnrGIaN4FEIuJuAKHy3Zdw6688zaTbO43aiOm1saYMqd XhmgCjAgfwY9/Z3QaFcZdVhCn6bSM1r0M+aI/3UagSM2KP6lcVF9/nVhWh87dJ/aQUdq /m69QYUE/lF3w5jySy5FA/FiA1FWScsnuiHmkqCFu3XrbexmnEDLfwAxCQKxSnrrBQnC F2FW+9Bconk5XoDsrBERy19r4gsjPjPKoUkusn57+zWiQWeYwF0OskFIx5wTKj6yBd4D NVig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="RcR7/OCp"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=grtvYJEi; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a170906bc4600b007af0bc6e10asi3154682ejv.213.2022.11.15.09.34.30; Tue, 15 Nov 2022 09:34:52 -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="RcR7/OCp"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=grtvYJEi; 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 S229937AbiKORY6 (ORCPT + 90 others); Tue, 15 Nov 2022 12:24:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232578AbiKORPH (ORCPT ); Tue, 15 Nov 2022 12:15:07 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB971EC66 for ; Tue, 15 Nov 2022 09:15:06 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668532505; 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=Yybjy0PIYNskaP5faHqnthg9WIcdfrQS9ZzYuDsOR40=; b=RcR7/OCp+pX+2ZBjJuvEpAejLUopOa3GAS6CXfhXrOwNyPFY9qRko+iEaCHw7SyJmNEuIU cOOcaHx9j8LODvYIGJKpdwEKVLodgHsSBQ+/qpolBasgI8YHenioADiRSeSJyFneQ6dWQE I8EFErSedz93x4HJFI6XpzBFU8DiDU/P4acdmGcRkVvkmoLIVjO2VVY2uwQ2GyYB7Ov1DJ B7g+5ylUW8vWnznUuIQ4ZO0BGxa+kB0ivxyr7kxi9TZRu4IBVEigbX9xYVdZoCruMzsWoC x807E0O6ElX5baV/QomA30FgR4YNnkzZNWm6CxwlgYQAA43TfcO1br3wOMSLrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668532505; 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=Yybjy0PIYNskaP5faHqnthg9WIcdfrQS9ZzYuDsOR40=; b=grtvYJEi+TN+aVj2Y1xGMCHSC39yTXgDLSnZ49pqIKQnNBNS+PlrtEPQJBBA3XNVCEWxhs 5PfC6JkUvArjAHBw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: replay log: Re: [PATCH printk v4 38/39] printk: relieve console_lock of list synchronization duties In-Reply-To: References: <20221114162932.141883-1-john.ogness@linutronix.de> <20221114162932.141883-39-john.ogness@linutronix.de> Date: Tue, 15 Nov 2022 18:21:34 +0106 Message-ID: <87r0y4m955.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-11-15, Petr Mladek wrote: >>> --- a/kernel/printk/printk.c >>> +++ b/kernel/printk/printk.c >>> @@ -3334,6 +3330,11 @@ void register_console(struct console *newcon) >>> * boot console that is the furthest behind. >>> */ >>> if (bootcon_registered && !keep_bootcon) { >>> + /* >>> + * Hold the console_lock to guarantee safe access to >>> + * console->seq. >>> + */ >>> + console_lock(); >>> for_each_console(con) { >>> if ((con->flags & CON_BOOT) && >>> (con->flags & CON_ENABLED) && >>> @@ -3341,6 +3342,7 @@ void register_console(struct console *newcon) >>> newcon->seq = con->seq; >>> } >>> } >>> + console_unlock(); > > So, without the above two hunks: > > Reviewed-by: Petr Mladek Note that we actually need those hunks to guarantee a consistent @seq value. The console_lock is the only synchronization mechanism available to read console->seq. John