Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp1098037lqp; Thu, 23 May 2024 08:56:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGztD8lGc2tcVD2VxxkE2ORTOridnFQqs8GxwhLsyrgeMJ3kr26CRrlggP2GQJjRxfdcrA68MpMGOm16B9YaiXR9H/v82jcHXFNUZ3rQ== X-Google-Smtp-Source: AGHT+IHwJgY4zFtRpst1Wdg4bygVDGFI+IeEKUSJIWUAicgaLVzFtPgTkosJIVZp9hSumFzxNruX X-Received: by 2002:a17:906:2dca:b0:a62:415b:b5c with SMTP id a640c23a62f3a-a62415b0c7fmr145324966b.5.1716479784338; Thu, 23 May 2024 08:56:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716479784; cv=pass; d=google.com; s=arc-20160816; b=v5eCEXUciU/usGVyxgoM97e5HC3EBn3dTzVwoeI5cTWpxL8Exspb/NCGJF05Ccz3Cd Q9MEXj8jEBrnSc61D9fMoGJ2BUdP6eFlIYIONcKkOHAfoeScKfesOLaDU4e+kuIbLhOJ NUvPcIQnQX5RlrVPbl+4cIsIj6gftIZuCqUdLkPn5Z0Hi51/1j1DLZ27a96GIueoQMKT /x+/a/3BqGz2qK5SMX5yBJzMmoXwacPap8RKVbcMUHX/QVdE07OlwiseHv/9JyNjI3W6 pedF15F/Uh4xttniHWcyJtFJS4cKTkG4OyGNcEXumExUgHa3vB/P1BaWAeTt9aq87Gzd NtGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date; bh=gsY80Jzksl0YxrP84C2oha/PZ9voiI1msK1mtPRQd1o=; fh=ZBRnys/BjokzD4xbXshubC4jAG50luKNTOE2MeaLvRA=; b=sRRQIsRNU+QMatKLZ2J6HoI2k38quq0vsMDoE+PFirETFLEpplkI7vA/iF08jwu/uG zqLzV1QLGjo1Emof7eUnn1NLuqDajkxSk8ifqBmEvJsK0mTzVF2Zf5Qc3aoMnHAsD7/L eBJrsYZ1JV/2iAl0bL27XnxVMazZM7cLnEfnb+IyETzt+FmvMP828N7WrWc5KGUkrPdP KOM26Yryln53JFvPJIGgckIA04Cv97CeoYU5akL4ph03/SHlTsTMGTz82f077lp3WIN3 AbEOGFozw5dHrMslJ6NG/TwQzEWs3iQiUxUk1me3LkmJS7jDWWPYQW2Zijh8t2wbLD0N tDiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=zte.com.cn dmarc=pass fromdomain=zte.com.cn); spf=pass (google.com: domain of linux-kernel+bounces-187747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17b21d56si1657171866b.371.2024.05.23.08.56.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 08:56:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=zte.com.cn dmarc=pass fromdomain=zte.com.cn); spf=pass (google.com: domain of linux-kernel+bounces-187747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 08BB31F2304D for ; Thu, 23 May 2024 15:56:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5141320DC8; Thu, 23 May 2024 15:55:49 +0000 (UTC) Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) (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 BBFCB18029; Thu, 23 May 2024 15:55:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.216.63.40 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716479748; cv=none; b=BrLs98Tq/vFT9LvpXlErPcQC2zsLelVW1nLUNtpwmwIEFH0w6apQo7+ZsHoTqmVq/o6h/bQqMdIWJzzUL20dGMViZvCnQ3xSGDAr4b0jFNlIrRJgADFGG0r1lPKQpyQt9ykl0l3KotNSHqWESvN/Sli2EdsHgPqm0c+RgiVGi9A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716479748; c=relaxed/simple; bh=gsY80Jzksl0YxrP84C2oha/PZ9voiI1msK1mtPRQd1o=; h=Date:Message-ID:Mime-Version:From:To:Cc:Subject:Content-Type; b=MaL/6uDhb8z8nAqM8fUIQLzVzIeliX8tAzqPIN4fTVWMAbfzqoQzhJHTf37Apldmf7lhd65ekC2szfSyul5J6lLYjXaLolnz9dQl/Kv1WiNSdTXpWgZEBvgq1obyrDjp9zrGTPjz1TuHFRtRM94sUqe+lc1h5fjGJxsBJRA1oK0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=63.216.63.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4VlXnm2gp1z8XrS0; Thu, 23 May 2024 23:55:40 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.97.17]) by mse-fl2.zte.com.cn with SMTP id 44NFtYS4076557; Thu, 23 May 2024 23:55:34 +0800 (+08) (envelope-from xu.xin16@zte.com.cn) Received: from mapi (xaxapp03[null]) by mapi (Zmail) with MAPI id mid32; Thu, 23 May 2024 23:55:37 +0800 (CST) Date: Thu, 23 May 2024 23:55:37 +0800 (CST) X-Zmail-TransId: 2afb664f66f9079-84b44 X-Mailer: Zmail v1.0 Message-ID: <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 From: To: , , Cc: , , , , , , , Subject: =?UTF-8?B?W1BBVENIICA1LjEwLXJ0XSBwcmludGs6IGlnbm9yZSB0aGF0IGNvbnNvbGUgcHJlZW1wdGVkIGJ5IGlycS9zb2Z0aXJx?= Content-Type: text/plain; charset="UTF-8" X-MAIL:mse-fl2.zte.com.cn 44NFtYS4076557 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 664F66FC.001/4VlXnm2gp1z8XrS0 From: xu xin When we're in the unpreemptible context on the same cpu with which the thread of console locates on, we should ignore this console for pr_flush, because it's a vain and always lead to timeout until the console thread get cpu resource. Fixes: e65be5f4dc3ed("printk: Update John Ogness' printk series") Signed-off-by: xu xin Cc: Zhang Yunkai --- kernel/printk/printk.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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_progress) diff = 0; 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) == smp_processor_id()) + continue; if (!(con->flags & CON_ENABLED)) continue; printk_seq = read_console_seq(con); -- 2.15.2