Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp318260lqh; Fri, 31 May 2024 02:12:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9ubCtS7e9wTTLBHf5nN3aLe1IcVMn32wEZF61oPtJ+Sq7LpYSRYzEU5RUuV/ka6TRbI8nnca3p99ssNJPXYMsbIVEHzp2jb1+gbhuyg== X-Google-Smtp-Source: AGHT+IE3XnU6fv7FIrspWr07cSwcYjmBaNgix4rSAG7bsBkXpjCrxarsqbFVgJ7SZQPAno2xlWLz X-Received: by 2002:a17:903:2302:b0:1f3:f1b:32a8 with SMTP id d9443c01a7336-1f636966ef7mr12356565ad.0.1717146736997; Fri, 31 May 2024 02:12:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717146736; cv=pass; d=google.com; s=arc-20160816; b=tgDXcL/qhnol4DZyd1HowKbGmIAwMagiGCsiU4PuwZCQjJpHKzwYdCrDbzKXHR8vA8 cNiX5Rf8Pyylj3AWiOwuU7Xdj0ok+8j7EmzwX5dsE1TJTPSZog133B3uj8sA95Bg2I+s 8FKkv5l7HpQ4OxaGaft25ASfoBEvg4xkJrFARB4duZ//j8gC6dZSTU6QyUyX7enyC2n9 eEp56QsfFHYdrY4s6smesrL/6KtvwbJdVA327xfD0u1jOV0AISrNV/WDBMkI7P7JSO8C +aiFchMiXBA3KUb16F9On0LjTFQJWcoxJR3X9osynwMDuywkgIrvYb8C9xpOtp/F4+M+ PV+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=DT5kVb5GgEEKGoo1ZoN8PwlN8iNvooLbd2zvQBMGthY=; fh=wvWTtP3rqrd6BGoSO5wu9bsQ+8dprLxYPBq2RJ5+xV8=; b=pQgQ2TF++v0iMO10TPIRWBHspFxonf6AAijqvduJ5N+T3Om2RUiJmcJZk2aJ3izk7W sBPxCAwHu2SP/njnhmdneaAckLPEuhMMKKSC24/g8t/DRGLQKwpp3d+ZgWCzUYzl/l+Y uyErQvKExO+V25iu48AZdDWdwYRHptc4myxf+hxDqmD7O3D7p8iq65VE3QpiKPeD66w1 fZ7NzWXQCFZFVfBoG0GwPytsswnXPlOP7Bq9cY5ZJ8MkZDQeQ4iodYIKHfCe5CCuGMgY SPT/iELmhe0UWm6+upTtvAwp0wYcU8MzhthaQIpPWEgllKH6fTxzTDXfMSgTNqRbOsZc C6CQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uM1Wcmpc; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-196550-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6323dec8fsi12253495ad.289.2024.05.31.02.12.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 02:12:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196550-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uM1Wcmpc; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-196550-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.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 4D8C12863C3 for ; Fri, 31 May 2024 09:10:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3586B78C90; Fri, 31 May 2024 09:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="uM1Wcmpc" Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 9BD4F224F6 for ; Fri, 31 May 2024 09:10:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717146648; cv=none; b=ekHLiSAo2mMxgQowPygPwDcxejmCn5KbLF1PMSo4CcvkjR2P6alv8sLj9riyoTiSTwCbHUj9mpGFnuC/vl8PrOjKfgwsBKwOZGL8YljykFQxa0jaA88+Rn4UZ3z2hVY++3gVT7uiKbAeQVZcyOiOvsZlWg8ELrGfvVTPNZ2rq1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717146648; c=relaxed/simple; bh=8k4FpKQXsM42cdPZUF+s9v5Mg/QNDBjS55kjfvqjdRM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=Nntj1U/XlJ8TUPQInAfZUdSrhXmxGMq28QROqdl4jxzys4UaN6XiDrgXWZc9rvYX8rzdoXYmL0MM0k6rKa+nYTtWGdLTjq5vjxx/VpQ7Vh4IuLDE7KQaRXM1mg3Xm5lVLrSF8NQ/6DWowbwk954wCTLBXBVVklSLgXz2vFsLEpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=uM1Wcmpc; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240531091042epoutp03ed34a98a8a356803d05d0dae48ddc70d~Uh8YWWszb2923629236epoutp03T for ; Fri, 31 May 2024 09:10:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240531091042epoutp03ed34a98a8a356803d05d0dae48ddc70d~Uh8YWWszb2923629236epoutp03T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1717146642; bh=DT5kVb5GgEEKGoo1ZoN8PwlN8iNvooLbd2zvQBMGthY=; h=From:To:Cc:Subject:Date:References:From; b=uM1WcmpcIWdeoerK8Hd+OetLjrBldJJsWsxYV+SV7mz7phLHJB/sDJASeNczoUCcH P/47KT2v2IP8IQh82vqG5YilbYBNu+VlIvlZHkzEnBUyDlyqoaPvwAqjOTRah8EO2V eLDRuZ7oLma7ThFzjYVYW6rsdA/MVv5Y2bhjYXW4= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240531091042epcas5p3d1ba5dcb04dc1049d8b56812ed2afc76~Uh8YE537D1063210632epcas5p30; Fri, 31 May 2024 09:10:42 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.174]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4VrHQl3yM9z4x9Pt; Fri, 31 May 2024 09:10:39 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 10.FD.19174.F0499566; Fri, 31 May 2024 18:10:39 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20240531091021epcas5p48fdbd6302bec7a91ff66272c600b0dab~Uh8ELyE0W1099010990epcas5p4Q; Fri, 31 May 2024 09:10:21 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240531091021epsmtrp2c323fb7a21eb06df67d6796a51a83ba7~Uh8ELFANl0785607856epsmtrp2y; Fri, 31 May 2024 09:10:21 +0000 (GMT) X-AuditID: b6c32a50-87fff70000004ae6-45-6659940ff427 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 5A.2A.08336.DF399566; Fri, 31 May 2024 18:10:21 +0900 (KST) Received: from testpc11818.samsungds.net (unknown [109.105.118.18]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240531091020epsmtip2cf9a4abb2229fdcd69b2ef2551973b03~Uh8DRiGP00314203142epsmtip2S; Fri, 31 May 2024 09:10:20 +0000 (GMT) From: hexue To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, hexue Subject: [PATCH] block: Avoid polling configuration errors Date: Fri, 31 May 2024 17:10:15 +0800 Message-Id: <20240531091015.2636025-1-xue01.he@samsung.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 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MailID: 20240531091021epcas5p48fdbd6302bec7a91ff66272c600b0dab X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240531091021epcas5p48fdbd6302bec7a91ff66272c600b0dab References: Here's a misconfigured if application is doing polled IO for devices that don't have a poll queue, the process will continue to do syscall between user space and kernel space, as in normal poll IO, CPU utilization will be 100%. IO actually arrives through interruption. This patch returns a signal that does not support the operation when the underlying device does not have a poll queue, avoiding performance and CPU simultaneous loss. Signed-off-by: hexue --- block/blk-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c index 01186333c88e..0afcd74ae939 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -913,7 +913,7 @@ int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags) q = bdev_get_queue(bdev); if (cookie == BLK_QC_T_NONE || !test_bit(QUEUE_FLAG_POLL, &q->queue_flags)) - return 0; + return -EOPNOTSUPP; blk_flush_plug(current->plug, false); -- 2.40.1