Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37027158rwd; Tue, 11 Jul 2023 08:32:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlFFhJHSnK9zscnnOEEiDo34N3MGVTBrl/5pfdHXHFzAShug5qSrWcaqAWCHp/r2TguoGbaR X-Received: by 2002:a05:6a00:2195:b0:668:81c5:2f8a with SMTP id h21-20020a056a00219500b0066881c52f8amr18468613pfi.17.1689089560664; Tue, 11 Jul 2023 08:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689089560; cv=none; d=google.com; s=arc-20160816; b=wRiK8r98pIVt3PXzbLWm7xDzqBv9lC387RmarofOWkLetd9It7SX5LzH4teWIA/DJb CAj5QYoUIKJow+6e3n44gG9p3y9ofmshmnMfDAFBFdNFcf3eOpB5dpAlHgKTM9weK8KC z0NAopwilc3W7jKrF9banZk68QP9CneNzAKZmBk2eMv2fQuwOSt8ArsDiXLKZ+Ewbe5H P/PxD0WR7n7v9/ITDRhFYIYh0gTS03h+JtEkvzo2kaxaw4WUF+1bCXzIR9MDoDnXTM2a EW33xp1YTlRh+ZiFSgxops67q3e+EZAp9iHiiEU+w64H103UQUXEH2mY5M8l7vANSI5D rzjA== 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=DWbO1Q44FIPTU4N/HOQTcbw3hKIu3NjTIDNtiAhWGKQ=; fh=rbrCzDVh+LMD4B3F2QViugie8KGhRiR3bVdfphtNjd4=; b=Z+EzGrnEg72OPvGMJxHglAYxeQ5+p8uDoqNmQ2i7TewEjcvo6WH5QWwunhATQH/NPJ odF4vidm8xbzBSJi25hnhLuOMFVWUmbDdjO4V0zrDnb8luUxrnQ6W4UCqld7VwVzKI/d eMOTnmNTLrNxNh5GFEVW9hhzGI2ZFFNKuzYaoFEOabaZlGU3+jI0IH+CdsZU1aMH34fS YI6WyHP1o6pn4NJGzuTKiO3XP052qBzfocQmyRvjoBvDZduoIrMAHI7uIJoZf4g8HU1D 5ujl2p9nYpsEZ+CkHuTXwo355SN3F/ceFLe9P/iS16qXMpNQZjueeDokSJVF+6ubslZh o1hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Som3JxKC; dkim=neutral (no key) header.i=@linutronix.de; 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 d4-20020a656204000000b005573ea6ead9si1569237pgv.306.2023.07.11.08.32.27; Tue, 11 Jul 2023 08:32:40 -0700 (PDT) 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=Som3JxKC; dkim=neutral (no key) header.i=@linutronix.de; 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 S231512AbjGKPXu (ORCPT + 99 others); Tue, 11 Jul 2023 11:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbjGKPXt (ORCPT ); Tue, 11 Jul 2023 11:23:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 958DB120 for ; Tue, 11 Jul 2023 08:23:48 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1689089026; 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=DWbO1Q44FIPTU4N/HOQTcbw3hKIu3NjTIDNtiAhWGKQ=; b=Som3JxKCnmruK0WXH+8VKj8Zp9tA5Gq+AW54Yx1PiJf2Kij2L9E24VqmYxxc4LFM+RAASg 7SU9Fj3hLf3o8dauLNYob/LXQdeknKEiVUbo0X7WTxGhqGjFHy9lVCTqsiL+7muWHzpyvU T1JIhnhrDYoxMbTZ5vexvNSS1OHIMusumJE2uLG8Ornu4L6hLArGb/gHyVOqePbIHQw5kX aD3nNROSh4O8HMOwR5lkonMqTrpyTKgYAw4HSwhpfgGobbVT+gBlQDDN927AWW45YNp/JQ OT3ax5gvJ9AVAWaR4cCtEQM8imy1Ar5OnhZsXqAyAmll7c4F1YpvMZoQW3f44g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1689089026; 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=DWbO1Q44FIPTU4N/HOQTcbw3hKIu3NjTIDNtiAhWGKQ=; b=XTw7SoGTF1RI/3t9zbP1W0dNHhSDRUkX1Z7F2M35Ots5PBJr6i3caah4mNOclef6ZYf7Oe W/SR9i+cljyFLrBQ== To: Sergey Senozhatsky Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH printk v2 4/5] printk: Add per-console suspended state In-Reply-To: <20230711150819.GC12154@google.com> References: <20230710134524.25232-1-john.ogness@linutronix.de> <20230710134524.25232-5-john.ogness@linutronix.de> <20230711150819.GC12154@google.com> Date: Tue, 11 Jul 2023 17:29:43 +0206 Message-ID: <877cr6pj40.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 2023-07-12, Sergey Senozhatsky wrote: >> @@ -2623,8 +2647,6 @@ void console_lock(void) >> msleep(1000); >> >> down_console_sem(); >> - if (console_suspended) >> - return; >> console_locked = 1; >> console_may_schedule = 1; >> } >> @@ -2645,10 +2667,6 @@ int console_trylock(void) >> return 0; >> if (down_trylock_console_sem()) >> return 0; >> - if (console_suspended) { >> - up_console_sem(); >> - return 0; >> - } >> console_locked = 1; >> console_may_schedule = 0; >> return 1; > > Interesting. console_locked previously would not be set if > console is suspended, but now it's always set, which in theory > changes the way WARN_CONSOLE_UNLOCKED() macro works in some > cases? Yes, Petr mentioned [0] this during the v1 review. His direct comment: "console_locked" seems to be used only in WARN_CONSOLE_UNLOCKED(). I could imagine a corner case where, for example, "vt" code does not print the warning because it works as it works. But it does not make much sense. IMHO, such a code should get fixed. And it is just a warning after all. And his final comment in that thread: I believe that @console_suspended is not longer needed. Let's replace it with the per-console flag and do not worry about races. John Ogness [0] https://lore.kernel.org/lkml/ZAieQtcs7YEuCCDa@alley