Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1572919pxb; Sat, 29 Jan 2022 09:56:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVXTYWkEhLCpnPevbaB5H/xGo0o/yJ/NsQgsT1iMJfiSLCLI+Jjr8r94+SCse0juT7XiN7 X-Received: by 2002:a05:6402:5107:: with SMTP id m7mr13599043edd.408.1643478965797; Sat, 29 Jan 2022 09:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643478965; cv=none; d=google.com; s=arc-20160816; b=hiKQBJultvtbmuYrVHiGcH5RW7I6cHQMFMLOncXyMCsp5I9yGsHHqSRv6odYAFXXgE t4STJuhDZ+Js5H1vgqkns/vgzFAGNm00NH8Ffe3lytP2M8ydotl3/iu3s2NNk1NY87Sy QO84hwC2zFJIsSiY5sb8XK/Z7oDb6ytNHiscQx2JDc4YasBh9HS86ZXjQsZxpkrWMGy7 /YH4oowcDHaYqQ7YB/tu0Mo6BrpHLyWJRx8MRxXGEOhL+KeV5EJM/q+YOQw9TrIuzoru 4eKP54A+fHW3ctKcGDTREa/IAJ59I2f2FRZDgFWsSs/dwfJZdlNEVb7nyaJv1u78pVqa fECw== 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=F975QErmCld1Ry9Jimo+ayxozR8wtzOzvEEKrRrpHg8=; b=KbM2oRShdAWylDJV7qK1wxDYJsnFTQ58KEf8cRbtr0i3ZpubnAVX1JOh7VsB9n+HF7 HD8J/OSS+aaHx7Q7M6YU1dasOIvNZZlobcUCh68IT5yjsJ33/3A0883VQm3QQkswaP8m +ZUb1MZKAFGXk1stEgTxFuWY4Y8mv8Gu26VyrEq7EyYpZLWLSwTId7m001NAD/awmRa8 Gb+8Pss4A+eJtaeqlU46nuv7HByhqJ9iFRO0v4z1HUSQY+TnInaB2wAFgI99xb1VoY0u I+0wteiELLddpRaQqrKzYcevOhpOU6NAUIkTSL6kYWE18OfD/GEPmq80i6N5NCG+CVo7 ze5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L2nrqU6O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si5874665edc.202.2022.01.29.09.55.41; Sat, 29 Jan 2022 09:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L2nrqU6O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1346252AbiA1Fz5 (ORCPT + 99 others); Fri, 28 Jan 2022 00:55:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346225AbiA1Fzz (ORCPT ); Fri, 28 Jan 2022 00:55:55 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 937BDC061714 for ; Thu, 27 Jan 2022 21:55:55 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id om4-20020a17090b3a8400b001b633bebd2dso2156045pjb.4 for ; Thu, 27 Jan 2022 21:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=F975QErmCld1Ry9Jimo+ayxozR8wtzOzvEEKrRrpHg8=; b=L2nrqU6OX1MI4KSXx7NJ/SkQBxlZBNIo7laKBrnx9b3waVP1kL6DCVyiGkt9CSLmxf xKRmcR15LcftGWX6psPkwD5R298inZVp9A0WeQc4emgywYRJg9W9/m4CG77JaMYW+3Do rQPfqpNq+YW+rwPv2uOTs0FX+iOVmCWplvaqY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=F975QErmCld1Ry9Jimo+ayxozR8wtzOzvEEKrRrpHg8=; b=yvMaxpQqTJp18YNxHjUI796EzYoQcwBIKFtYonn0FZLiaSE40fwbBu75SKYBO+pzM7 tdBpsT3TSUGcax5enLNjy+FkyFW21o+Qj7qWar9m7iH9d1fSrd2yV0VmlSvAlQoEg5k5 zEagAM+UU+UH7q/H1MneF/PXQU1hdS8NRKmH2iHcQnxU8GiQ8vzJ/qWThHdJPksFC9z+ E9jkVTke1zjzqNggXwWOd2UVuTR4+QsRiz7uOqprDCtjHf6nA5j5TuC4lHVBh18T1VSI mR29vlHEsWzFmFhv04iOpb6Xm6pVqTVDST6MQ4DNPqyjnTQK1UGSc3VMhzu/GpTA8vZ3 74XQ== X-Gm-Message-State: AOAM531r4bIci1C1iskvjc8cXfpEIJmWoNUyyJsP3GGA4UHPCm9z7/NQ pjARSQ1UuErFUlSXPw0EayCOPA== X-Received: by 2002:a17:902:7c17:: with SMTP id x23mr7259148pll.123.1643349355127; Thu, 27 Jan 2022 21:55:55 -0800 (PST) Received: from google.com ([2401:fa00:8f:203:434a:300b:6887:c7e6]) by smtp.gmail.com with ESMTPSA id k3sm8248221pfu.180.2022.01.27.21.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 21:55:54 -0800 (PST) Date: Fri, 28 Jan 2022 14:55:49 +0900 From: Sergey Senozhatsky To: John Ogness , Petr Mladek Cc: Stephen Brennan , Sergey Senozhatsky , Arnd Bergmann , Steven Rostedt , Andrew Morton , Sebastian Reichel , Andy Shevchenko , Luis Chamberlain , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] printk: Drop console_sem during panic Message-ID: References: <20220126230236.750229-1-stephen.s.brennan@oracle.com> <20220126230236.750229-5-stephen.s.brennan@oracle.com> <87fsp9pm6q.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (22/01/27 16:03), Petr Mladek wrote: > On Thu 2022-01-27 10:28:53, John Ogness wrote: > > On 2022-01-26, Stephen Brennan wrote: > > > --- a/kernel/printk/printk.c > > > +++ b/kernel/printk/printk.c > > > @@ -2759,7 +2782,7 @@ void console_unlock(void) > > > * flush, no worries. > > > */ > > > retry = prb_read_valid(prb, next_seq, NULL); > > > - if (retry && console_trylock()) > > > + if (retry && !abandon_console_lock_in_panic() && console_trylock()) > > > > As Sergey suggested [0], I would like to see the call to > > abandon_console_lock_in_panic() move inside console_trylock(). This will > > help to avoid the race between NMI CPU halt and the internal sema.lock > > spinlock. Thanks John. > I would prefer if it is done as a followup patch. The code in this > patch is still needed. It helps when the non-panic CPU is busy > with pushing many pending messages. Also it is a more conservative > approach. No objections. This series fixes issue at hand, so conservative approach makes sense. On the other hand, we are at -rc1 and it seems like a very good time to discuss/look into/work on/etc. solution for the remaining cases/races/etc.