Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6317121rwp; Mon, 17 Jul 2023 20:24:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlE8y5rKWeIhs4bb/Cz+PI3MTxvrby05usdpEZ78WHNZrP3DrGXkHuEXXF99WMpqGXU4g74f X-Received: by 2002:a05:6a00:1142:b0:682:f529:6d69 with SMTP id b2-20020a056a00114200b00682f5296d69mr16087343pfm.7.1689650692042; Mon, 17 Jul 2023 20:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689650692; cv=none; d=google.com; s=arc-20160816; b=cbi6PXbS5M6F7NqZ0Ctt7j5DgArhNkU1za4+Mhhms6kEgkrux/N5OT62P5a07NabUo BD8Pjdc/2Ktz2DqmwKDOehqnkixio/jz7A3XIyK5ryCmaUfyC0ne7Wh7X4gRTn2mrj76 w7Cz+3sPZgY8+6YDmM8d4sRgi8hwjfUNy+zuqb2jOZip3d4Z50FYuJvA7h2Zw9zPVz7g Y3Lq3snpf7wChSIfzbSmn6JxpnnLwN8BlAIwq4zW64rzu9gs9GB7xmCIT+htafOE62AH xL5UKy78ewMtShivqF9IvWfmOCE6xCqQoXXm+BR7mGeC8L7ACJo0xASpiEA+HQNqjvig 8qGA== 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=qocaf1Ps72Y5X78MMqEBO1Mf3QN4QabQiTaMiLaTMtw=; fh=q7Z/rKL+KIbFund01sogDpTvPeDzU4Ew1asLTbwSUy0=; b=euZmia6cEEY9Hle/DLMXknOsS9McKeAQf6DBEsJ1Qcm2N2+tMJ7rcT2iR3z/YnI9Lh Bmw8bHDejl+2WtTITmT/vDd9lUBWHPfA5wB+sCWrdTpfOmA8Zqmsmr4Mb2y09ibeqBuj ZiffcvFrx+F+d1BaKqy4T+F1wyJSMtvav09W4DY69zwcov5cW7+s8JW3q/dqhqRtLHFR CF7Lck7vCUndM3pvGH8Ri4Ws7sWSLF9GPAN88jBmMFGvr5Hz6EErBVnfXtSzX2nThvdD nOrK6iGinePtw2OmaVQG7l7XhPahomR98AVAgrkgmBxPeLMng0bLZSdqwh5Ku3xkXpzu sW9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ONjclki5; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h20-20020a056a00219400b00682399fa4f9si811832pfi.300.2023.07.17.20.24.40; Mon, 17 Jul 2023 20:24:52 -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=@chromium.org header.s=google header.b=ONjclki5; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230381AbjGRDS5 (ORCPT + 99 others); Mon, 17 Jul 2023 23:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbjGRDSx (ORCPT ); Mon, 17 Jul 2023 23:18:53 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3D02E6C for ; Mon, 17 Jul 2023 20:18:52 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-55adfa72d3fso2931144a12.3 for ; Mon, 17 Jul 2023 20:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689650332; x=1692242332; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qocaf1Ps72Y5X78MMqEBO1Mf3QN4QabQiTaMiLaTMtw=; b=ONjclki5nvVeHG0HQUbxOSuwrcQZelNicBRPkz+i3ubokewQamj3zUXhYTrt/NBIHp /6CLjsvSg0goevOLAHTXSPr67sxp0sfcVDFecwpdUUZS9KsyamsZspNgoGGcclDAkPff 5jHe1sX2KRGY4yMEojm6fg2LsrxTaTQ4xTrTk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689650332; x=1692242332; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qocaf1Ps72Y5X78MMqEBO1Mf3QN4QabQiTaMiLaTMtw=; b=ZIJhZLXuIGGizIZxKx2TJHruE1m2YXj/j0dPI32Rb1dJFgx0wA3GiEaPPnElM7gCIG 8c2G/OKsM21ehWIlIPdTHyZ2WEuO3luaNEm/K79aoSeARHZQzfv2P9KRARLk9Ya6TMQl cmEGOj+KRhvlgDtEKql//cirrDf5EA5gZdweJsMvlXuK79LxkPEPtbXeqxHUTCv0sOMB ZcsDr6IT2es0SNoHOOmiWiq0ae3teKJdQJa6FEZhMz038qjJx//ceFnE79XJrIc8NDwf RcNN7ZW2QMneIqJhHUPDXmZwZZ5fMcWNoospPVxx8oC6tV2YgTbNy66bii96Oyi5QiMu UDcA== X-Gm-Message-State: ABy/qLar6VJ1oZ2T+0Kn6cOCc6+tL76QJLfL688uMclxNnfYKEYS/qn6 gnxGbkQ/7y3jxpBvtTj9i8t8VQ== X-Received: by 2002:a17:90a:e693:b0:25e:7fdd:f39c with SMTP id s19-20020a17090ae69300b0025e7fddf39cmr11817276pjy.16.1689650332180; Mon, 17 Jul 2023 20:18:52 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:49d1:35f7:f76f:e7b1]) by smtp.gmail.com with ESMTPSA id 4-20020a17090a1a4400b00263f8915aa3sm5966598pjl.31.2023.07.17.20.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 20:18:51 -0700 (PDT) Date: Tue, 18 Jul 2023 12:18:47 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Petr Mladek , 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: <20230718031847.GB955071@google.com> 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, 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 (23/07/17 21:52), 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: Sergey Senozhatsky