Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1873795lql; Wed, 13 Mar 2024 10:24:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxivUk6O2MPyxBNrWbt1F92eT27M49xIUG1UHa0936sGJKIFPkDQEZszieaagGf4ffyo7PfKkK3aeHzys/nY78D83jvAQOCnEgJn2XfQ== X-Google-Smtp-Source: AGHT+IH9eqKPZD8dfB6ZMX4GJw4aUpW3mrMxHF/x3c3GsZ+wI3KDJQ3wvutnGKbLIvP8nfAXxwuo X-Received: by 2002:a17:902:f68b:b0:1dc:6152:7c24 with SMTP id l11-20020a170902f68b00b001dc61527c24mr4451498plg.43.1710350660094; Wed, 13 Mar 2024 10:24:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350660; cv=pass; d=google.com; s=arc-20160816; b=UqQzFZz2K6BhG/JdF8QExoZFTwp1lKRsxlZyYnlndNQPFj7awOl5WcYPPDTizThvLq uK+8LjbazSiFvuOL1sSxlkcKG6j+Uol8OYw2qwILNmaFwzSRKSYU06bYaauj0zuaPIiw SmtBVPHrhUFhJ014rEBzPOaFwDm8dG7YpZNaaX75KO8zJbLneh61keUVtvcdl7ZnSw7b pB87k51BMkAX3AzeDvuHc3ZYNct3whCuR3mazy4gZGDdVP4Lmvsvp21v/9C1lgZJNm9/ PTu9UUtnSv3XfKJyv1/LQvIxqaUG+yDcb6jYF1fTjhE+hxdHrTeilBBtT5y2aBHB1YE3 wolA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tBqAu8aYi/DEW5zgZhSgtfezB667h7Xexz17oI+K3DM=; fh=xCzL2+ajmpYXMHKN9yMVnSWUGS21d3i9QCj6H/6gaSg=; b=d6dhTZMtCb5cdi3/0sPCsQcw8cfzH/X2bcxzsMwSWn0W7H/VsWe9lgwdc+mhXw1hlQ VXnBocxGBcAWlIIPO8418mojqEbLjU7y0C4uHx7hH4h+PORcRA7tDxgTI3MlimBvK8Mh EMaW1fUbcjlTVaTFsyyjyN717qSutbBiqySfhXCvnJ0/zxs5hy9jKY3X/zeX415sssfR lhls3m45Sq0Jcye8Lq7ItZiBHNd/vGSk/KeC2SuLqYnY6CcB0jiFcX0r2pUE5EAigxlj zgT1T7+jweQy4Xdb1x3zgx2dwLwiD5SrkO45vuRmI6cxGIY8bZUrqhlCyOUfMQzAHdyJ s55w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=is349ZVj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y6-20020a170902ed4600b001dca6379ba1si8917577plb.150.2024.03.13.10.24.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101921-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=@kernel.org header.s=k20201202 header.b=is349ZVj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 E140228FDE3 for ; Wed, 13 Mar 2024 17:15:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5718D12BF29; Wed, 13 Mar 2024 16:41:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="is349ZVj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 50B5E12BEB2; Wed, 13 Mar 2024 16:41:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348062; cv=none; b=Kbzaq4hHeC5Ux9yOgcUexhPeXJnyEQlcgR6Wzr61IyHGroL3DJVQyLO/EYYegcH8JnmlY4ztW/IM+rVGribVCZ//Q7b2eYs3rQtQyi2abugqpkxoAoDF08jeMufZNzGj3g4AbTihEZd7NfWqHzFoP0fQtWtKfcifS6oJu8JB1y8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348062; c=relaxed/simple; bh=PowxuJQcK0zXz7vu+ktPazmRv9F90wojoKT9raPpi44=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HnKynGVt7xBwL9QZeSITYqngWzTIFtBLPgS2HO8KpJIyJQZnJS0fASg9FKnECMEn2kocUyEyk9PI1cXnZ8xMOQ6zv/R1+j1EwdwkyZRa5IofDz2e/R9t+bhB97PPe95fo7UEp3vmjZMQpgf3aUFr8QglrLdwuaNYLods0k7yqJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=is349ZVj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4714BC433F1; Wed, 13 Mar 2024 16:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348062; bh=PowxuJQcK0zXz7vu+ktPazmRv9F90wojoKT9raPpi44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=is349ZVjlnH6IoeZuAox0CumiC3/OVBchpI8PFs1Xx6kPkyNVNbP97Gn58uxmiJfu v7IVwlDI9EFzb7gSMfzXfOLCC9weRv98kDTxI2qjI782MWgAnZsMybK0f19KyXZ0Ff xs5jkf6A2+G9YOLwWq90bw+tLO7fqTEgyapIw8n2sFsytOYFWjdj7c+EKOPGCPVPcI bGposp1lGk0zaTMmVSJ1rOkLE+2MQL2fukKuP5uLYXL1KGWlduUTA4z/POP9PSPV8I SshfpuwuYo8uSW/nKBVW4GYL50y67dWjKIBXQSPw0+2RxCen2b7vd8Jr/E+M+Wjpfi /fy+2XDizI+AQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christoph Hellwig , Andreas Herrmann , Tejun Heo , Jens Axboe , Sasha Levin Subject: [PATCH 6.1 53/71] blk-wbt: pass a gendisk to wbt_{enable,disable}_default Date: Wed, 13 Mar 2024 12:39:39 -0400 Message-ID: <20240313163957.615276-54-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163957.615276-1-sashal@kernel.org> References: <20240313163957.615276-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.82-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.1.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.1.82-rc1 X-KernelTest-Deadline: 2024-03-15T16:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Christoph Hellwig [ Upstream commit 04aad37be1a88de6a1919996a615437ac74de479 ] Pass a gendisk to wbt_enable_default and wbt_disable_default to prepare for phasing out usage of the request_queue in the blk-cgroup code. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Herrmann Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230203150400.3199230-9-hch@lst.de Signed-off-by: Jens Axboe Stable-dep-of: f814bdda774c ("blk-wbt: Fix detection of dirty-throttled tasks") Signed-off-by: Sasha Levin --- block/bfq-iosched.c | 4 ++-- block/blk-iocost.c | 4 ++-- block/blk-sysfs.c | 2 +- block/blk-wbt.c | 7 ++++--- block/blk-wbt.h | 8 ++++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index e4699291aee23..84b4763b2b223 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -7060,7 +7060,7 @@ static void bfq_exit_queue(struct elevator_queue *e) blk_stat_disable_accounting(bfqd->queue); clear_bit(ELEVATOR_FLAG_DISABLE_WBT, &e->flags); - wbt_enable_default(bfqd->queue); + wbt_enable_default(bfqd->queue->disk); kfree(bfqd); } @@ -7206,7 +7206,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e) blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q); set_bit(ELEVATOR_FLAG_DISABLE_WBT, &eq->flags); - wbt_disable_default(q); + wbt_disable_default(q->disk); blk_stat_enable_accounting(q); return 0; diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 3788774a7b729..72ca07f24b3c0 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -3281,11 +3281,11 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input, blk_stat_enable_accounting(disk->queue); blk_queue_flag_set(QUEUE_FLAG_RQ_ALLOC_TIME, disk->queue); ioc->enabled = true; - wbt_disable_default(disk->queue); + wbt_disable_default(disk); } else { blk_queue_flag_clear(QUEUE_FLAG_RQ_ALLOC_TIME, disk->queue); ioc->enabled = false; - wbt_enable_default(disk->queue); + wbt_enable_default(disk); } if (user) { diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index a82bdec923b21..c59c4d3ee7a27 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -837,7 +837,7 @@ int blk_register_queue(struct gendisk *disk) goto put_dev; blk_queue_flag_set(QUEUE_FLAG_REGISTERED, q); - wbt_enable_default(q); + wbt_enable_default(disk); blk_throtl_register(disk); /* Now everything is ready and send out KOBJ_ADD uevent */ diff --git a/block/blk-wbt.c b/block/blk-wbt.c index afb1782b4255e..8d4f075f13e2f 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -637,8 +637,9 @@ void wbt_set_write_cache(struct request_queue *q, bool write_cache_on) /* * Enable wbt if defaults are configured that way */ -void wbt_enable_default(struct request_queue *q) +void wbt_enable_default(struct gendisk *disk) { + struct request_queue *q = disk->queue; struct rq_qos *rqos; bool disable_flag = q->elevator && test_bit(ELEVATOR_FLAG_DISABLE_WBT, &q->elevator->flags); @@ -705,9 +706,9 @@ static void wbt_exit(struct rq_qos *rqos) /* * Disable wbt, if enabled by default. */ -void wbt_disable_default(struct request_queue *q) +void wbt_disable_default(struct gendisk *disk) { - struct rq_qos *rqos = wbt_rq_qos(q); + struct rq_qos *rqos = wbt_rq_qos(disk->queue); struct rq_wb *rwb; if (!rqos) return; diff --git a/block/blk-wbt.h b/block/blk-wbt.h index 7e44eccc676dd..58c226fe33d48 100644 --- a/block/blk-wbt.h +++ b/block/blk-wbt.h @@ -89,8 +89,8 @@ static inline unsigned int wbt_inflight(struct rq_wb *rwb) #ifdef CONFIG_BLK_WBT int wbt_init(struct request_queue *); -void wbt_disable_default(struct request_queue *); -void wbt_enable_default(struct request_queue *); +void wbt_disable_default(struct gendisk *disk); +void wbt_enable_default(struct gendisk *disk); u64 wbt_get_min_lat(struct request_queue *q); void wbt_set_min_lat(struct request_queue *q, u64 val); @@ -105,10 +105,10 @@ static inline int wbt_init(struct request_queue *q) { return -EINVAL; } -static inline void wbt_disable_default(struct request_queue *q) +static inline void wbt_disable_default(struct gendisk *disk) { } -static inline void wbt_enable_default(struct request_queue *q) +static inline void wbt_enable_default(struct gendisk *disk) { } static inline void wbt_set_write_cache(struct request_queue *q, bool wc) -- 2.43.0