Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1936207lqb; Mon, 27 May 2024 02:24:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV62Sm8b23f57iFztGlg/kl4alHO7lXgS4J+4hjBjZJ+B+paSHlKH7U/RatR3hVmgA11q797lrbgdj+bTzcRR3QkVEAwfh4bN5jON7rZg== X-Google-Smtp-Source: AGHT+IF2HDPp4pdTE/i4pKkbt448cfdv3yonZoCtEgy3Pv6goQdGdReBGttAVFOhzlyyKxN+lSrq X-Received: by 2002:a0d:d489:0:b0:618:9007:a172 with SMTP id 00721157ae682-62a08e8ee73mr88230417b3.40.1716801858033; Mon, 27 May 2024 02:24:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716801858; cv=pass; d=google.com; s=arc-20160816; b=Ed4U3X5BAp44t8bsHHel1828MSznW69MyJPOIUxVdPzWpU30aeIDtT9sPfjIwpI/y5 /ejnaOSzsFAcXVvG8BN03egp4ExAxEVZI/Oo26g+7PgW3EEn/DJf4V57qpvCjcwbcB57 sGPmodizuCQG5ijlNJUwJEwWvxTlqzYMnO66gF5vQscQ8AT+M2iYxAvjOm4HE7+gxgq7 QvTAjyEnEfan5M3ZT6qcuR+xReRXmqxuHDidi6ATRXtGniRtS+VbKp5TzwgcnSw/nvW3 O5mysbhuujxLe9M8gI/EdBmEDeMRhYT/Pxw1k4vsxSeb4OwagK4WA7kWgDDwCBWWIgfs Xyew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=KN/Df7cVH1hfGLVbWzKUrHY38uo6ydApmWkCbVJqn+c=; fh=grnWYAmYzRuYMdLo/4NTrOjQ33Q3XYsZXVkESN4PoA4=; b=YPt7hXr+FvJ5quvCuxjJlO6dIasmGF3rLRNaSFMxcv12CDRwbykXEa0vW2W91j4/7w AzZhH+KKZY5LvaCTkEWNyAHxfZJITaGBnRun2e6xDWUoqRiKSgn92HL+sVNwGJcnGYW0 uGoA32UJUdFm/DmJ333nJlZlypvr94lSLm4TZEsi8WhHf7n4lyoeDa36V47ZNifGGWEK GWOeMvfRGtppmcQwjocoU1kVl01eBVZU4bKHQ8jPq3Z+lfhTjz+rqzTf6djvudd0smzH cVgtJTS3McJNiHZ/V/UavZPZ7uNVRk84kTDgG4Zs7oeOozztvV3LH6YYshBl5lLinWFE faJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cRCLwCR3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-190312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abcac379si820169885a.44.2024.05.27.02.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 02:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cRCLwCR3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-190312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BE1521C21323 for ; Mon, 27 May 2024 09:24:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF05A13A3E6; Mon, 27 May 2024 09:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cRCLwCR3"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fp6PvISi" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 8B76F3B295; Mon, 27 May 2024 09:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716801847; cv=none; b=RPdYofIvoeEKYLO76M/wNMZG/BAK8nt14lvrY/Qrb3bSPzC2xhW9DjhUlUAk/5RplOdVID7i7TxpYd6LMxOFbrnKIAMCId2Qn9E411olGXcgLz6HnegPVimswcwDQRvgus4ms8MArrwMYx8/W/fmCctcPPVeCIAZyCmfJFrV0Ho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716801847; c=relaxed/simple; bh=KN/Df7cVH1hfGLVbWzKUrHY38uo6ydApmWkCbVJqn+c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Pb5D56dk2EBziCtjmbIqYaTuGwLgfJGs3bPbqcA7IBN/w4ubSJBbr34x8iVcQLu2Hm24gT5AQ2TEDYT0xyMoLmkVDn2FtqVKJNrrdUcnqGkYvRyDnyeQnXgHfOhi14Zp6eJoB1hbEFiBAXQV6P06n7ARU9R63TD/GbgsuUk8b3k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cRCLwCR3; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fp6PvISi; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Mon, 27 May 2024 11:24:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716801844; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KN/Df7cVH1hfGLVbWzKUrHY38uo6ydApmWkCbVJqn+c=; b=cRCLwCR3YCF/RSe4ks3cWTNQegoy6h7aU7wyx/vQvzm5wyAaD6L3KG0CNVSUZjQNSTfj9U 1OJjMOc/SdM/sbewdoHJKwYFQ+G4UvXRVcpwgHFRXXWdVcjxbV+CB/OGgLaS53+9aqrRzH 7rGFP0iUNEYNrYMCiKPo1EDDOpY79blVGHLdCpJEt1cgbY4407g6IRpt9N9XacpYeBQiAd 8T3QAlchJnCAG6hwM5TTEc8ESUVdQ6c59niLM3AuQcn6mUR+XxjpuYjqZu6WFPLxK2TYTd PFs6Ok74N0VNlOGpc0N1BbBQ+rqe/cpa6POzeo4qR95jbUKboSvsAH3V3/qa1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716801845; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KN/Df7cVH1hfGLVbWzKUrHY38uo6ydApmWkCbVJqn+c=; b=fp6PvISiFRAUp9nnXxCWfy+JVAcGhIb+56FdPCV7TCeEYAJvzc8gsDwy+40Y55O1lnh60W PDpP3y6Id2lpo2BA== From: Sebastian Andrzej Siewior To: xu.xin16@zte.com.cn Cc: john.ogness@linutronix.de, rostedt@goodmis.org, zhang.yunkai@zte.com.cn, yang.yang29@zte.com.cn, liu.chun2@zte.com.cn, si.hao@zte.com.cn, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Subject: Re: [PATCH 5.10-rt] printk: ignore that console preempted by irq/softirq Message-ID: <20240527092403.x2m7SpvL@linutronix.de> References: <20240523235537910_yxfGMbTcSOmMkcfuK2d8@zte.com.cn> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20240523235537910_yxfGMbTcSOmMkcfuK2d8@zte.com.cn> On 2024-05-23 23:55:37 [+0800], xu.xin16@zte.com.cn wrote: > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 7f27cfee283e..faab85dd4439 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -3735,6 +3735,14 @@ bool pr_flush(int timeout_ms, bool reset_on_progre= ss) > diff =3D 0; >=20 > for_each_console(con) { > + /* > + * When we're in the unpreemptible context on the same cpu > + * with which the thread of console locates on, we should > + * ignore this console, because it's a vain. > + */ > + if (!preemptible() && con->thread && > + task_cpu(con->thread) =3D=3D smp_processor_id()) > + continue; > if (!(con->flags & CON_ENABLED)) > continue; > printk_seq =3D read_console_seq(con); This does not apply. There is `may_sleep' set earlier. There is no console_lock() around for each=E2=80=A6 The other question is which kernel started enforcing might_sleep() for pr_flush(). This should be applied to all kernel or none so we don't have random behaviour across kernels (5.4 yes, 5.10 no, 5.15 yes). This is a delay of max 1 sec during bug() and panic(). Not sure how "critical" this is=E2=80=A6 Sebastian