Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1446715rwl; Thu, 5 Jan 2023 13:51:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXsgSpoaylVR/mz7hxR70t3+taBvJDcdbjC+b2UUnsX0IEGvxInCs9J93UsECmu+JGdLi2il X-Received: by 2002:a17:903:40cb:b0:192:8502:77f9 with SMTP id t11-20020a17090340cb00b00192850277f9mr38959008pld.27.1672955486516; Thu, 05 Jan 2023 13:51:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672955486; cv=none; d=google.com; s=arc-20160816; b=JAY31afY0qVm+I21ZDVkV+SLj7oUjCXVGWEVBsPlv+iQb36OLbGMViCcg0JWBtYqZF L2fMVLyq2d9DiJl+aEZw+PQgSmUQWYS+N/+JkK2kGPEYBU+AfGt84in++KWaSI0tGcY1 dJXpiK36AmSobUa/4krAXB1TlUNTuFP5fV6QOZPbhzyUvlWKNxBwOoS6v8dY47EvdSMR w7P1G8K3s/ZEMN+W9U6ZQIZVtKSExLAZXZkkQlT6hgFw7orsMD2Pi59/i5WDgfXdqUoW 2/vVU3c5dCBUHm/WXCziXf3k+t3TubIYtcvEeGwA+oTAlJ7sjaMqyZjbEjpPwomkQ18N bt+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=TrXn/UsH93lS2A5CebmmFeBERFF7L0+KOIci0sQ1Uks=; b=m7WgS3mZh8142N/LsnHOjOGst5L2wVrzSlmpT9FSTEZb9SozV4c9Bfe5DxoYOM/4Si rhJnVDm3YWxa4Jr50hxV9glJhr62TQSk0Ji2Va0uN6UBm0cw9qSdLi0Hrb9o02NZscKk oBrWcELcBLtCAY5eMkul3D9hBIgUks3kvgET+xuolWkbts0vLl4hoApuo4e56f8OjIhA auwrHRrIaAaYOcuqSJ1WNesTFQeHtyKxPQK/fq3zaewZg7dJPyyVT+kpUDN5m1Pi4Xd/ nQ3IdHGCBDlDu5P8tMvA0cxyEqLrVS1mHGV4/M+N9AJH6TyTCGmarGla8UyDg3enfykB WiDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TH3z2zdM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a170902768400b001892e5980a7si36236851pll.405.2023.01.05.13.51.19; Thu, 05 Jan 2023 13:51:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TH3z2zdM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235737AbjAEVYp (ORCPT + 57 others); Thu, 5 Jan 2023 16:24:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235725AbjAEVYm (ORCPT ); Thu, 5 Jan 2023 16:24:42 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBD1E6319A; Thu, 5 Jan 2023 13:24:41 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so3381322pjj.4; Thu, 05 Jan 2023 13:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=TrXn/UsH93lS2A5CebmmFeBERFF7L0+KOIci0sQ1Uks=; b=TH3z2zdM6CYRaMvFVyXRvtLK7NTJD3DGsChzYPOzW0OE4ZDlFOsOzaP6/eB4Ul1i0S RvBDUXmn0foulgSyG8vos47nKdRPIfR1ZnRG9+QooLDJD4bl8UGdwD2Ekgoiq64Pj6Ct 4g73y9tPKA7rpecPy84mOTVWDD66qkegYW7JiecBtg/BMFhtOseOae82jL/t556MGJ2f cqQuDHRAVVGGiSwrS54wu2eiQnpNHtlF5dvuGzJnlPp6fh07+vN8MTivXhRuStVsOX8q fksqIdmbke68jfL5DfePwyqOxw1Aee4pUqlp9fy6nBSDR0SbpZYaxXJRiu/eeaT8u9e9 SB9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TrXn/UsH93lS2A5CebmmFeBERFF7L0+KOIci0sQ1Uks=; b=I+/tTGlUU+EIQSyTTzNSVgBM/y7AXwxrk4b4CzIjw4VKKst5lcYABqd07RGGpvmK67 ohfQg/rgTsQKbexbzjSZnKoYy28W1Q1zptV5x6CQVQi0Sawwb5gvcWyQbg+OR2KF4ZjK dwwZ64hhxkSRAJlPSVT3V3HbcBNosfHKR+Z5m7/06Q8PP2F4m5zlrv1KbMOL9LH8ebAS 4SfyVHTHR9SzysnRLyuNoZGEerF0XXx0GaQARlgYsRg+78mQlUvfPuqCuviMwhtRTrzZ IxCTTdb7Q9ie4oFQstL1P+2fyZJeoVUxjCX+3HcV+eOGYJCqo4PT6XLzRl5ypxGAUXPP IOig== X-Gm-Message-State: AFqh2kq7hHcKwZDjHFnoOsklK+cqHOVLSDCst0ZRFPYTqi0Uyy4EPWVl CPq7qa77GPBLAcofVc2RUZM= X-Received: by 2002:a17:90a:f80e:b0:225:d290:dcb0 with SMTP id ij14-20020a17090af80e00b00225d290dcb0mr44797327pjb.4.1672953881187; Thu, 05 Jan 2023 13:24:41 -0800 (PST) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id y1-20020a17090a134100b002260b06befbsm1736859pjf.16.2023.01.05.13.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 13:24:40 -0800 (PST) Sender: Tejun Heo From: Tejun Heo To: axboe@kernel.dk, josef@toxicpanda.com, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Tejun Heo Subject: [PATCH 1/4] blkcg: Drop unnecessary RCU read [un]locks from blkg_conf_prep/finish() Date: Thu, 5 Jan 2023 11:24:29 -1000 Message-Id: <20230105212432.289569-2-tj@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230105212432.289569-1-tj@kernel.org> References: <20230105212432.289569-1-tj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Holding the queue lock now implies RCU read lock, so no need to use rcu_read_[un]lock() explicitly. This shouldn't cause any behavior changes. While at it, drop __acquires() annotation on the queue lock too. The __acquires() part was already out of sync and it doesn't catch anything that lockdep can't. Signed-off-by: Tejun Heo --- block/blk-cgroup.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index ce6a2b7d3dfb..99674e23cf88 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -672,12 +672,11 @@ struct block_device *blkcg_conf_open_bdev(char **inputp) * * Parse per-blkg config update from @input and initialize @ctx with the * result. @ctx->blkg points to the blkg to be updated and @ctx->body the - * part of @input following MAJ:MIN. This function returns with RCU read - * lock and queue lock held and must be paired with blkg_conf_finish(). + * part of @input following MAJ:MIN. This function returns with queue lock + * held and must be paired with blkg_conf_finish(). */ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, char *input, struct blkg_conf_ctx *ctx) - __acquires(rcu) __acquires(&bdev->bd_queue->queue_lock) { struct block_device *bdev; struct gendisk *disk; @@ -699,7 +698,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, if (ret) goto fail; - rcu_read_lock(); spin_lock_irq(&q->queue_lock); if (!blkcg_policy_enabled(q, pol)) { @@ -728,7 +726,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, /* Drop locks to do new blkg allocation with GFP_KERNEL. */ spin_unlock_irq(&q->queue_lock); - rcu_read_unlock(); new_blkg = blkg_alloc(pos, disk, GFP_KERNEL); if (unlikely(!new_blkg)) { @@ -742,7 +739,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, goto fail_exit_queue; } - rcu_read_lock(); spin_lock_irq(&q->queue_lock); if (!blkcg_policy_enabled(q, pol)) { @@ -778,7 +774,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, radix_tree_preload_end(); fail_unlock: spin_unlock_irq(&q->queue_lock); - rcu_read_unlock(); fail_exit_queue: blk_queue_exit(q); fail: @@ -805,10 +800,8 @@ EXPORT_SYMBOL_GPL(blkg_conf_prep); * with blkg_conf_prep(). */ void blkg_conf_finish(struct blkg_conf_ctx *ctx) - __releases(&ctx->bdev->bd_queue->queue_lock) __releases(rcu) { spin_unlock_irq(&bdev_get_queue(ctx->bdev)->queue_lock); - rcu_read_unlock(); blkdev_put_no_open(ctx->bdev); } EXPORT_SYMBOL_GPL(blkg_conf_finish); -- 2.39.0