Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4816633rdb; Tue, 12 Dec 2023 10:02:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHt6lG5e0qtU25xsVAjCzcHVPbO3y5lgWF/NjEWak5+yFN2dD7CHjsb2xXZcymJ6gnrxkyH X-Received: by 2002:a05:6870:23aa:b0:202:d78c:c4cf with SMTP id e42-20020a05687023aa00b00202d78cc4cfmr2881999oap.63.1702404171621; Tue, 12 Dec 2023 10:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702404171; cv=none; d=google.com; s=arc-20160816; b=vCEd6NjdYqBK9kbkEawOx+EUi+1AfnX2XcBMKGuX9RlnnOoZ9YLKqCGiU8XaK+mGlM cD5zBkVPZmRW6J+zhznYliy7YN39ID1vgEzHJhNadqvx1+E4sXNPP9mos3z/OLCYir6s jPRoqx29VBMyH97+jFqyk0aADmdqZgNX0YZ9CwooI2jrXJoFDxTVlLvyvifVast08WCw pm+jQ2fvIw6/YTm63o172reeKaEJhILjCXBNL/CMQVBRG16+/1aZuXRSuf/Chf9gcQFS JzA614fz2551o/cSg9Aeu3iOCTMTiAUJ1c9GIMM22/6suYCJYgg+gjR/W3aEnVak+J2R C0Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=PNF90TjcDNx5VXo+RX2zacD8yj70X1dJBpsDRoeWT0w=; fh=K+/WM9+CT/fMjrV2RcC7eC9CN1kAkxEzCAeDX7of1XM=; b=PlKy9Xq8SRTEdbJRrSqnx/wUHXoKy/7SOb+p7CBNzeBdAIgFpxX2Z/Z2i/YNugToHz 9tQuiBgqPszFAOhlE2fm/bcHLSf0Jd/qn6A2YBi/MABRwFB5hIRUeI3ygXCrsZ0NGPha XxbQatkRGjCrCP0GpWR043LGXTAcgmDSMPxL4V1c/Jl3R2HTrybpu251jy8oJLMoE6CC Som8vNrWgblSqisJjeKgcp0CTyEbBPurk7oQ+eM+Pltu/nDVGLoGMefC8QbRBPKymhxb 6v6oC8kCO/yRwWGpGcqbNaeXXRVqXJfUqxpPNc/Z56I5HtCr9TmfoT/HKVa5y6W1PAKn hscw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bv2-20020a0568300d8200b006d8764f0c87si1231128otb.293.2023.12.12.10.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:02:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id F1C68805062A; Tue, 12 Dec 2023 10:02:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377055AbjLLSCO (ORCPT + 99 others); Tue, 12 Dec 2023 13:02:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232546AbjLLSCN (ORCPT ); Tue, 12 Dec 2023 13:02:13 -0500 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DD8CAD for ; Tue, 12 Dec 2023 10:02:17 -0800 (PST) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-67ef4c73e02so218146d6.2 for ; Tue, 12 Dec 2023 10:02:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702404136; x=1703008936; 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=PNF90TjcDNx5VXo+RX2zacD8yj70X1dJBpsDRoeWT0w=; b=KIV1ovLRjKflUwFsrcAECsW6sGxtCn4l4VME/6UOwopsAYsDuY3ZJytbTz5SrlMIR4 Hxf/MdGV9zuWxEd1sf4Izq3MXyztdt+/2QOTPBMf9+KA3YD9LEx20tl6cfIhvgFOTAhe CMAwTb29wzLywVzuw4FWFwPAfpYpw5lZeNOj7EnDGL/jTr6Q+tu2eARp/clD0GUA9rmd XJCP7MOOkkHivGU7qMHVNroDeo2IFYDGwTwAYIpKwiK9+AOyaYoYsAlTGGs1olgwhYBV E10tn0aMUB5PsJbbZ8yQ/tgkaivoSYRf/E80GNAoo8ZKUj18pa5IS8AkVpIG4tp8VnCK SUCg== X-Gm-Message-State: AOJu0YxoTUa1l2FIDqrDKhDyUGlwcfQQwhe/XLRUtRL8W0Roz/iC7ZSc lOIjFv3aHGLmOuqZZQ7HBQZT X-Received: by 2002:a05:6214:141c:b0:67a:a721:9e92 with SMTP id pr28-20020a056214141c00b0067aa7219e92mr7175039qvb.67.1702404136629; Tue, 12 Dec 2023 10:02:16 -0800 (PST) Received: from localhost (pool-68-160-141-91.bstnma.fios.verizon.net. [68.160.141.91]) by smtp.gmail.com with ESMTPSA id rc3-20020a05620a8d8300b0077dc7a029bfsm3902634qkn.100.2023.12.12.10.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:02:16 -0800 (PST) Date: Tue, 12 Dec 2023 13:02:15 -0500 From: Mike Snitzer To: Christoph Hellwig Cc: Hongyu Jin , agk@redhat.com, mpatocka@redhat.com, axboe@kernel.dk, ebiggers@kernel.org, zhiguo.niu@unisoc.com, ke.wang@unisoc.com, yibin.ding@unisoc.com, hongyu.jin@unisoc.com, linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev, linux-block@vger.kernel.org, Jan Kara Subject: Re: [PATCH v4 1/5] block: Fix bio IO priority setting Message-ID: References: <20231212111150.18155-1-hongyu.jin.cn@gmail.com> <20231212111150.18155-2-hongyu.jin.cn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 10:02:29 -0800 (PST) On Tue, Dec 12 2023 at 8:13P -0500, Christoph Hellwig wrote: > On Tue, Dec 12, 2023 at 07:11:46PM +0800, Hongyu Jin wrote: > > From: Hongyu Jin > > > > Move bio_set_ioprio() into submit_bio(): > > 1. Only call bio_set_ioprio() once to set the priority of original bio, > > the bio that cloned and splited from original bio will auto inherit > > the priority of original bio in clone process. > > > > 2. The IO priority can be passed to module that implement > > struct gendisk::fops::submit_bio, help resolve some > > of the IO priority loss issues. > > Can we reword this a bit. AFAICS what this primarily does it to ensure > the priority is set before dispatching to submit_bio based drivers or > blk-mq instead of just blk-mq, and the rest follows from that. Yeah, I agree.. something like: Move bio_set_ioprio() and caller up from blk_mq_submit_bio() to submit_bio(). This ensures all block drivers call bio_set_ioprio() during initial bio submission. > > +static void bio_set_ioprio(struct bio *bio) > > +{ > > + /* Nobody set ioprio so far? Initialize it based on task's nice value */ > > + if (IOPRIO_PRIO_CLASS(bio->bi_ioprio) == IOPRIO_CLASS_NONE) > > + bio->bi_ioprio = get_current_ioprio(); > > + blkcg_set_ioprio(bio); > > +} > > I don't think we need the check here as anyone resubmitting a bio should > be using submit_bio_noact. This patch moves the caller from blk_mq_submit_bio() to submit_bio(). So I'm not sure why you're seizing on the "resubmitting a bio" usecase as reason for dropping this check (which occurs in submit_bio). The original justification for the check is detailed in commit a78418e6a04c93b ("block: Always initialize bio IO priority on submit"). Mike