Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6638099rwp; Tue, 18 Jul 2023 03:45:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFCmzWdLwmGJd7hnxNx8uTTWAjWa+7RZSITx10ZZV/H55G8AQUX+BYulOyMOnasQFBOUWsj X-Received: by 2002:a17:907:1011:b0:97d:ee91:df83 with SMTP id ox17-20020a170907101100b0097dee91df83mr12125307ejb.61.1689677110113; Tue, 18 Jul 2023 03:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689677110; cv=none; d=google.com; s=arc-20160816; b=y41dNB2QFPBe7U3y3nj4EKlvUv8+yMEfLf6tw8gbzJ0IJGHwq8AtXscFXwIzkV+ePD Rvnh5sJmSZEgUTpTJ+2VOhUDdfZ0rc9GLe+b+ONkeR095b9K1kB22SE9+3tqH8OpHWc0 /eE/jCXm4b9cIIwktZQwMPwMC7kfkw1mGgmsUONpdLPvx5NPv7RG+ylwPqbHY/1Cu3MJ dnojErylqt0VOLtDz9x8KuGEwytVd98B5bh629BqfLIZqQ14HGIOCtaNzrdqz5LlKF02 h2igZdbkk/iImFmb1IrU88GqqTXu5oqc31My+Wnw8Ggg8z/ItyOVrnB+72rlu4XWbxtD ceew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=50UkDd30LUCKJrV0PxCEUFi1cZLFwTdFg/ishYaBuTs=; fh=oPFVAToQkY6bsl1Vt24pO33VB3QR8tT4rK/qyEfOsuk=; b=qumFQJqvBdPHSz5rQPTrZushfoJhNgp6m9up/ECWBOSBKpm8cKR1ffO4Ah6Ur0Jo24 pGDcmipk9WYGnAGUW5xpr8SjcPLxyK3zcoOrgkvEKSEivChMv7aAua3iqsaIp/9gE2EI lhKfEwbYJp0smlycBOr16ww4raSsqaoH7TKeKQfPsvmJ9aXDEN3pVxJXCrFm4hMi5aiu uufmv0UqppqQrUFnKvt5tKcYo23Ej8NsmTq1GJ675lpwMIic1vBRXANOYQMrhC1R1Bh+ qpxSI7RxR0jX7+PxXL8GiZ3u3Iyty5XfKLcJ+Np2YWOTfan4a/j8j/VCXxbqzVsnz69H lUJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="UBKIFE/N"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a170906668c00b00993150e5326si892509ejo.626.2023.07.18.03.44.46; Tue, 18 Jul 2023 03:45:10 -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=@suse.com header.s=susede1 header.b="UBKIFE/N"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbjGRK2s (ORCPT + 99 others); Tue, 18 Jul 2023 06:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjGRK2q (ORCPT ); Tue, 18 Jul 2023 06:28:46 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B57361B6 for ; Tue, 18 Jul 2023 03:28:45 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 734C321880; Tue, 18 Jul 2023 10:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1689676124; h=from:from:reply-to: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=50UkDd30LUCKJrV0PxCEUFi1cZLFwTdFg/ishYaBuTs=; b=UBKIFE/N5zIQI0Z9Yipqv5tYmSzOr3YJ8CsELBI90i3PU9lqLxeKZwE0gd2LKfhbYN+lD9 CMUD2JHM2ezW8rPLsza3pAfwL3hG0m7eub+e6YRtZfeX5yCW57rR6q+WUY/P/2QddxLWXt BpbWb3j5vFFobh+A50/rlSrp2NVUQcI= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 4EB822C142; Tue, 18 Jul 2023 10:28:44 +0000 (UTC) Date: Tue, 18 Jul 2023 12:28:43 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v3 4/7] printk: Do not take console lock for console_flush_on_panic() Message-ID: References: <20230717194607.145135-1-john.ogness@linutronix.de> <20230717194607.145135-5-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230717194607.145135-5-john.ogness@linutronix.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Mon 2023-07-17 21:52:04, John Ogness wrote: > Currently console_flush_on_panic() will attempt to acquire the > console lock when flushing the buffer on panic. If it fails to > acquire the lock, it continues anyway because this is the last > chance to get any pending records printed. > > The reason why the console lock was attempted at all was to > prevent any other CPUs from acquiring the console lock for > printing while the panic CPU was printing. But as of the > previous commit, non-panic CPUs will no longer attempt to > acquire the console lock in a panic situation. Therefore it is > no longer strictly necessary for a panic CPU to acquire the > console lock. > > Avoiding taking the console lock when flushing in panic has > the additional benefit of avoiding possible deadlocks due to > semaphore usage in NMI context (semaphores are not NMI-safe) > and avoiding possible deadlocks if another CPU accesses the > semaphore and is stopped while holding one of the semaphore's > internal spinlocks. > > Signed-off-by: John Ogness Reviewed-by: Petr Mladek Best Regards, Petr