linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com,
	akpm@linux-foundation.org, hannes@cmpxchg.org,
	linux-kernel@vger.kernel.org, tj@kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH 15/15] block: use irq variant for blkcg->lock
Date: Mon, 25 Jun 2018 11:12:43 -0400	[thread overview]
Message-ID: <20180625151243.2132-16-josef@toxicpanda.com> (raw)
In-Reply-To: <20180625151243.2132-1-josef@toxicpanda.com>

We inconsistently use the irq and non-irq variants of spin_lock for
blkcg->lock, which results in awesome lockdep messages when I have to
use a irq safe lock inside the private data callbacks.  Fix this to
always use the irq safe variants.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 block/blk-cgroup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index fd614c31ccd2..ab88d96d2e43 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -226,7 +226,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
 	}
 
 	/* insert */
-	spin_lock(&blkcg->lock);
+	spin_lock_irq(&blkcg->lock);
 	ret = radix_tree_insert(&blkcg->blkg_tree, q->id, blkg);
 	if (likely(!ret)) {
 		hlist_add_head_rcu(&blkg->blkcg_node, &blkcg->blkg_list);
@@ -240,7 +240,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
 		}
 	}
 	blkg->online = true;
-	spin_unlock(&blkcg->lock);
+	spin_unlock_irq(&blkcg->lock);
 
 	if (!ret)
 		return blkg;
@@ -381,10 +381,10 @@ static void blkg_destroy_all(struct request_queue *q)
 	list_for_each_entry_safe(blkg, n, &q->blkg_list, q_node) {
 		struct blkcg *blkcg = blkg->blkcg;
 
-		spin_lock(&blkcg->lock);
+		spin_lock_irq(&blkcg->lock);
 		blkg_pd_offline(blkg);
 		blkg_destroy(blkg);
-		spin_unlock(&blkcg->lock);
+		spin_unlock_irq(&blkcg->lock);
 	}
 
 	q->root_blkg = NULL;
-- 
2.14.3

  parent reply	other threads:[~2018-06-25 15:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 15:12 [PATCH 0/15][V3] Introduce io.latency io controller for cgroups Josef Bacik
2018-06-25 15:12 ` [PATCH 01/15] block: add bi_blkg to the bio " Josef Bacik
2018-06-25 15:12 ` [PATCH 02/15] block: introduce bio_issue_as_root_blkg Josef Bacik
2018-06-25 15:12 ` [PATCH 03/15] blk-cgroup: allow controllers to output their own stats Josef Bacik
2018-06-25 15:12 ` [PATCH 04/15] blk: introduce REQ_SWAP Josef Bacik
2018-06-25 15:12 ` [PATCH 05/15] swap,blkcg: issue swap io with the appropriate context Josef Bacik
2018-06-25 15:12 ` [PATCH 06/15] blkcg: add generic throttling mechanism Josef Bacik
2018-06-25 15:12 ` [PATCH 07/15] memcontrol: schedule throttling if we are congested Josef Bacik
2018-06-25 15:12 ` [PATCH 08/15] blk-stat: export helpers for modifying blk_rq_stat Josef Bacik
2018-06-25 15:12 ` [PATCH 09/15] blk-rq-qos: refactor out common elements of blk-wbt Josef Bacik
2018-06-25 15:12 ` [PATCH 10/15] block: remove external dependency on wbt_flags Josef Bacik
2018-06-25 15:12 ` [PATCH 11/15] rq-qos: introduce dio_bio callback Josef Bacik
2018-06-25 15:12 ` [PATCH 12/15] block: introduce blk-iolatency io controller Josef Bacik
2018-06-27 19:06   ` Jens Axboe
2018-06-27 19:20     ` Josef Bacik
2018-06-27 19:24       ` Jens Axboe
2018-06-28 13:26         ` Josef Bacik
2018-06-28 15:35           ` Jens Axboe
2018-06-25 15:12 ` [PATCH 13/15] Documentation: add a doc for blk-iolatency Josef Bacik
2018-06-25 22:36   ` Randy Dunlap
2018-06-25 15:12 ` [PATCH 14/15] skip readahead if the cgroup is congested Josef Bacik
2018-06-25 15:12 ` Josef Bacik [this message]
2018-06-27 19:06 ` [PATCH 12/15] block: introduce blk-iolatency io controller Jens Axboe
2018-06-27 23:53   ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180625151243.2132-16-josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).