From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6F23C433F5 for ; Tue, 24 May 2022 04:34:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0EFF6B0072; Tue, 24 May 2022 00:34:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBE206B0073; Tue, 24 May 2022 00:34:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAACC6B0074; Tue, 24 May 2022 00:34:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CACE56B0072 for ; Tue, 24 May 2022 00:34:32 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9EDE021069 for ; Tue, 24 May 2022 04:34:32 +0000 (UTC) X-FDA: 79499370384.30.2086EA6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id 2D2AE10001D for ; Tue, 24 May 2022 04:34:29 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7867761208; Tue, 24 May 2022 04:34:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F977C385AA; Tue, 24 May 2022 04:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653366870; bh=/4PzKarf9FLLX+CAcx710Fdds9eFxxCXnHAxyF1yTcc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WNN/hP8+1WxYNdG/BGcwO5Luds+lsF2npcnIELGBbgMaJ/at6wh5oe3bBPC8OEF0x Ht0Du6ADFlo6EWA641CuDqqlxhcBAsI72ic30RmCzRppcnojGAAkex4jwa7r10HvWN EVxG+ASs6Fe16RKgRlrn9anfggDB1WXyL/y2/X0c7cTvyL6UZhFI4FEY03mcRn19vM KxOUSS2oFftcgC7PKFXpKO8HWRuevwVi9G3zt9HDjntmTdHA2S2se1NQ59z+bEyY7K PA5r5iGhmP6jAolokOOAQC78BdFH/mLwLff+NWkkakiUNdbSPsolw2EwfiUPmV+cuP /giiWNxLiQinQ== Date: Mon, 23 May 2022 22:34:27 -0600 From: Keith Busch To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, linux-xfs@vger.kernel.org, Changhui Zhong Subject: Re: [PATCH V2] block: ignore RWF_HIPRI hint for sync dio Message-ID: References: <20220420143110.2679002-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 2D2AE10001D X-Stat-Signature: nj5qjsmy8jfznxuyxcaadxtnc6xr8bah Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="WNN/hP8+"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf14.hostedemail.com: domain of kbusch@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kbusch@kernel.org X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1653366869-929975 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 23, 2022 at 09:02:39PM -0600, Keith Busch wrote: > Here's a bandaid, though I assume it'll break something... On second thought, maybe this is okay! The encoded hctx doesn't change after this call, which is the only thing polling cares about. The tag portion doesn't matter. The only user for the rq tag part of the cookie is hybrid polling and falls back to classic polling if the tag wasn't valid, so that scenario is already hangled. And hybrid polling breaks down anyway if queue-depth is >1, so leaving an invalid tag might be a good thing. > --- > diff --git a/block/blk-mq.c b/block/blk-mq.c > index ed1869a305c4..348136dc7ba9 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -1146,8 +1146,6 @@ void blk_mq_start_request(struct request *rq) > if (blk_integrity_rq(rq) && req_op(rq) == REQ_OP_WRITE) > q->integrity.profile->prepare_fn(rq); > #endif > - if (rq->bio && rq->bio->bi_opf & REQ_POLLED) > - WRITE_ONCE(rq->bio->bi_cookie, blk_rq_to_qc(rq)); > } > EXPORT_SYMBOL(blk_mq_start_request); > > @@ -2464,6 +2462,9 @@ static void blk_mq_bio_to_request(struct request *rq, struct bio *bio, > WARN_ON_ONCE(err); > > blk_account_io_start(rq); > + > + if (rq->bio->bi_opf & REQ_POLLED) > + WRITE_ONCE(rq->bio->bi_cookie, blk_rq_to_qc(rq)); > } > > static blk_status_t __blk_mq_issue_directly(struct blk_mq_hw_ctx *hctx, > --