Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp175644lqr; Wed, 5 Jun 2024 02:37:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9QtOCu8reRowH415ntr3WBWCGTwfkt7nxJmnumNT7uh+SvMyk42vWwIfNvcIYmKcQYeoBxnO8GiBa+eLOd9qkevI4YogmUHiDEByZig== X-Google-Smtp-Source: AGHT+IGR/9biNMRFQK4IZg4MaAk5h4eueKlKIv8Y50/YUlspgKtu4IJHQG0i04xcQWo1NQIbSWaA X-Received: by 2002:a17:902:c404:b0:1f4:8e4a:b77a with SMTP id d9443c01a7336-1f6a5a0f9dfmr22149385ad.18.1717580250604; Wed, 05 Jun 2024 02:37:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717580250; cv=pass; d=google.com; s=arc-20160816; b=gKBAS30L1T5V6+esGtWhgcvcBaIul8NMRbj6PGQ125GjliK/u37MDZhe4P5+XRtvYf uTXrb1+hSALKgkDLhtsECDbBdsiBeN4HrgzZEN1Pw7cGiWQVmxo7YWGsoATylaR6RR/E NoMfkAiEezSY1Dxik063oIttTmgQduZYpqlJd8et9fRGwK5ggvQBrHkHOndsz2HQxtb/ /oiD6LYRTbQEyeJrByGE3R33ylHcxUsl81sRFGc149iZHXfnwreqF1EN9kG5HDuNPQwf D8pZIzb7kzFuo6u7a84vmQJDMf5gPUrIIdClLYp+VjAEaRoFkCChrn0jNfgOsK3iI0Pd k5Dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EIHWoHv/QvLBTsW9LF2D/X7toxaXXwp5mTAPZT4vSL4=; fh=xVSY9QtQzTuXupO43WgBKAb/Mp1HZIY1N9bifpTnPXU=; b=I+gxAar+/SzqfhxDLtGhrBGEVYu/awkTRVy85IgFLHI8OFIl/A1gBqzz8z1Ve7U7AR ayJ/a3Rjb3Rjxo2d3w9YG9PxBYnMjTC+gURaRQpmTKWyKX41VdnW/xLkkASi7c1lhWKD wP6h91faq3KhnwlL+23rojDx8Ug4EA2C9aqwidQ+wD7xKMTieALUp9N0ncQvANDvjWDx tDRNfsMhw+32xnUklCJvNb4fxhkR4cE1v6D/aPp5QsrjIft+UiydspWtEmVPLYZxwrp3 6CKgV5c7L4bu1XK93sdrepcGrXVitkomarL/T8yx9ODmEpcenvR0SR7mPzOQPhkvue8h TpJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jThfrU1f; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-202115-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202115-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233d43csi100667185ad.98.2024.06.05.02.37.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202115-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jThfrU1f; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-202115-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202115-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 76E87282B8F for ; Wed, 5 Jun 2024 09:37:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0407E191473; Wed, 5 Jun 2024 09:32:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jThfrU1f" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96A6218FDB0 for ; Wed, 5 Jun 2024 09:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579948; cv=none; b=TzCLwZrtCa5XSSxSmDQA56CDPQrNjvEOuft4qvFl6Y9ajDSVc/2mGBPsVVGSdTKJ/8s5NA6DzsHx6Yp+C/1Q8OCJCXtVCPtKHGKI670oMtn8PAHTjgNsjW1ICZP/MKSS3tpaGvbukGufBd3lc0dFP9qoMUvq0KvrtVMrSiFu7/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579948; c=relaxed/simple; bh=A/gOzPUwckRQSfrNHNR843u/F/x3yV4eQiL9bWvwnB4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G1a96zF0M9QYxLefNwFVzlbkfAX9upL13ycjbGWhLhoMJCE7TUnTS+q4hNAkN+BEMVZhX3craOSl+fnSDz+78NZ5TUjnAHUPCvKeKtHZt50R1Sd26vOdOZZhXkcRHBA2Ww0raZe5TXqApMs+UAVAODQmGvdWG6t7XIwto3e0VY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=jThfrU1f; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717579945; 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=EIHWoHv/QvLBTsW9LF2D/X7toxaXXwp5mTAPZT4vSL4=; b=jThfrU1fUmKUCq+aasAAt+/WKpb24lhdanEP4K5zA5y+GFMBG9GlW1n1VivC578D9yFlEt kE5dyBKYu8NibNmyV8ot+mBXqf0fIsbg9uTLBJw+zekuyNISmBQBhx2iidFGwm4yb65QBW ee20ih2xHkNygHhymOKuHAIR8TNSHtU= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-2qNonAO3N--pz8xTvsN-BQ-1; Wed, 05 Jun 2024 05:32:21 -0400 X-MC-Unique: 2qNonAO3N--pz8xTvsN-BQ-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6ae19130518so23337156d6.3 for ; Wed, 05 Jun 2024 02:32:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717579941; x=1718184741; 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=EIHWoHv/QvLBTsW9LF2D/X7toxaXXwp5mTAPZT4vSL4=; b=n7fXcPaqoK9koaVUlAN42KEb9GZ6xpDzfGgY6z827sE/LvsLJFt5XPImDUDGslPd0k Uknj/BETPgEVhiRT+tZ5tcCc81AAvd0jaRnIbInTJTtAddK+36swEBTC/O9V8XdaBWkl XrPhB+gVlTu0qrdETi3t8f/b4P32FoUFbUn+KBRrpWRu8xKHs1LHgo/PWx97IjX5wXV6 8bJ81D3Q97rHz9Zk2htiseuuCgJzSGMERokbYUj+0XhMA1N6kw5vUvCEESEyhdW+DvxV BjzSXk4h/e0Q5GwMbibQeR2oqaIpr585euNGKHKXbklnffkeRW9p3GPRh7HH9HJPKZZr xcIA== X-Forwarded-Encrypted: i=1; AJvYcCVGHR5KT57TqIm1W3dqYYujh3bZpsL4trpZK87rNJ8aevJ3GIzbo5yhDqlkYQ3LXMdlaxgNvn0CP80RSxYa7wi2guWEBPOZBtKPVgE0 X-Gm-Message-State: AOJu0YwoBHLxsj8wWSelS2djSJXC5vPNrK2pTer9Gjel3ynNPl3n+gc6 Bg3KlGWnctrQ0+DZ/8UMVj/hLqSU0cA8rT4APY2kJKA1GzLKNDo/ZDJHR8jt4p/J9MSJvbTGBU1 9LB6CI4q21IsCZM0qzIF5Jh5adFUJtmzyVWnhTEiWrBKenN+5vDcHvyH3eMOxYg== X-Received: by 2002:a05:6214:3a89:b0:6af:2676:1a67 with SMTP id 6a1803df08f44-6b02bf749b2mr20745146d6.28.1717579941394; Wed, 05 Jun 2024 02:32:21 -0700 (PDT) X-Received: by 2002:a05:6214:3a89:b0:6af:2676:1a67 with SMTP id 6a1803df08f44-6b02bf749b2mr20744926d6.28.1717579941039; Wed, 05 Jun 2024 02:32:21 -0700 (PDT) Received: from jlelli-thinkpadt14gen4.remote.csb ([176.206.3.168]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ae4b405e14sm46658136d6.80.2024.06.05.02.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:32:20 -0700 (PDT) Date: Wed, 5 Jun 2024 11:32:15 +0200 From: Juri Lelli To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Jonathan Corbet , Greg Kroah-Hartman , Jiri Slaby , Sreenath Vijayan , Shimoyashiki Taichi , Tomas Mudrunka , linux-doc@vger.kernel.org, linux-serial@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Paul E. McKenney" , Josh Poimboeuf , "Borislav Petkov (AMD)" , Xiongwei Song Subject: Re: [PATCH printk v2 00/18] add threaded printing + the rest Message-ID: References: <20240603232453.33992-1-john.ogness@linutronix.de> <875xunx13r.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875xunx13r.fsf@jogness.linutronix.de> On 05/06/24 10:15, John Ogness wrote: ... > Yes, that probably is a good candidate for emergency mode. > > However, your report is also identifying a real issue: > nbcon_cpu_emergency_flush() was implemented to be callable from > non-emergency contexts (in which case it should do nothing). However, in > order to check if it is an emergency context, migration needs to be > disabled. I see. > Perhaps the below change can be made for v2 of this series? Yes, this seems to cure it. Thanks for the super quick reply and patch! Best, Juri > diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c > index 4b9645e7ed70..eeaf8465f492 100644 > --- a/kernel/printk/nbcon.c > +++ b/kernel/printk/nbcon.c > @@ -1581,8 +1581,19 @@ void nbcon_cpu_emergency_exit(void) > */ > void nbcon_cpu_emergency_flush(void) > { > + bool is_emergency; > + > + /* > + * If the current context is not an emergency context, preemption > + * might be enabled. To be sure, disable preemption when checking > + * if this is an emergency context. > + */ > + preempt_disable(); > + is_emergency = (*nbcon_get_cpu_emergency_nesting() != 0); > + preempt_enable(); > + > /* The explicit flush is needed only in the emergency context. */ > - if (*(nbcon_get_cpu_emergency_nesting()) == 0) > + if (!is_emergency) > return; > > nbcon_atomic_flush_pending(); >