From patchwork Wed Nov 14 16:02:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10682851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D44914D6 for ; Wed, 14 Nov 2018 16:02:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51D1C2BB07 for ; Wed, 14 Nov 2018 16:02:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 462512BB0E; Wed, 14 Nov 2018 16:02:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8593D2BB07 for ; Wed, 14 Nov 2018 16:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387552AbeKOCGk (ORCPT ); Wed, 14 Nov 2018 21:06:40 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:41862 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbeKOCGk (ORCPT ); Wed, 14 Nov 2018 21:06:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=papcWxloEQE8c8vyKvyq1fINjxLlmJwTRehyLyCSAwE=; b=RJcF3k1Vu+NQVN9PsOKF34D2Rq 83pOrbUDR4GTJ0SOTIna3bF1aowtlufuIrHXIysGKRy2pTrsqsW5NfetYaPRHMlxo52fc3hWckrb5 E9NF21n6G4pKjKeYmPSKbDR0yG2Es9idsZMq7Ms0fXFJD1Sz+ruEYsUMCmIgrm8JdMrUUUP/d9+fT 3U6rKRsKsV+WR0Khaf5H+9WVkH5i2c2uPg1toYzkumKftQztsi/dT2tFvT0oLY2I05Ip7Yq7+SRrN bftVeiL4uTRc1qhC4V/PKg/ZCCPqKz0aoRAKADQTFJvp6pe/E3gf47SS51sMKmavidIziq3XGjkBb WhZivN9A==; Received: from 089144211136.atnat0020.highway.a1.net ([89.144.211.136] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMxcv-0006Dm-3U; Wed, 14 Nov 2018 16:02:49 +0000 From: Christoph Hellwig To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-mmc@vger.kernel.org, drbd-dev@lists.linbit.com Subject: [PATCH 10/16] blk-cgroup: move locking into blkg_destroy_all Date: Wed, 14 Nov 2018 17:02:13 +0100 Message-Id: <20181114160219.28328-11-hch@lst.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181114160219.28328-1-hch@lst.de> References: <20181114160219.28328-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/blk-cgroup.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 717ab38a6c67..3ba23b9bfeb9 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -349,8 +349,7 @@ static void blkg_destroy_all(struct request_queue *q) { struct blkcg_gq *blkg, *n; - lockdep_assert_held(q->queue_lock); - + spin_lock_irq(q->queue_lock); list_for_each_entry_safe(blkg, n, &q->blkg_list, q_node) { struct blkcg *blkcg = blkg->blkcg; @@ -360,6 +359,7 @@ static void blkg_destroy_all(struct request_queue *q) } q->root_blkg = NULL; + spin_unlock_irq(q->queue_lock); } /* @@ -1182,9 +1182,7 @@ int blkcg_init_queue(struct request_queue *q) return 0; err_destroy_all: - spin_lock_irq(q->queue_lock); blkg_destroy_all(q); - spin_unlock_irq(q->queue_lock); return ret; err_unlock: spin_unlock_irq(q->queue_lock); @@ -1222,10 +1220,7 @@ void blkcg_drain_queue(struct request_queue *q) */ void blkcg_exit_queue(struct request_queue *q) { - spin_lock_irq(q->queue_lock); blkg_destroy_all(q); - spin_unlock_irq(q->queue_lock); - blk_throtl_exit(q); }