From patchwork Mon Jun 25 15:12:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10486563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FD2E60230 for ; Mon, 25 Jun 2018 15:14:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FF7C284C4 for ; Mon, 25 Jun 2018 15:14:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24AB9284FF; Mon, 25 Jun 2018 15:14:07 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, 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 D2D75284F9 for ; Mon, 25 Jun 2018 15:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934936AbeFYPNl (ORCPT ); Mon, 25 Jun 2018 11:13:41 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:42460 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934879AbeFYPNJ (ORCPT ); Mon, 25 Jun 2018 11:13:09 -0400 Received: by mail-qk0-f193.google.com with SMTP id u62-v6so5135284qkf.9 for ; Mon, 25 Jun 2018 08:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=9y7CqGBN0TOAnxl5iFoh9qAAnZAPUKalhtMJvSXgCMA=; b=am9EMPeedoR7dbs5flGHcMsyF+0dUFS/3KNxFWY/I4pDOCqXzzy1gPehNxTD4URxgN xJCKN2XW0V25SodLCw34ICrs0+mOE0DYB7VvqintDs8WDBq8x9KLF9Np7G12eiWLxaZZ Ky12+N811o8lP/o1ymax+25zqM8O7dGg6zhxPBhQXnlnLRdxpnlkdUmG7FfPXsjDR9EM b0qqldsPGFRTfPbUm2lr1zeSghHdPOW8LFUsLCjldNa4bZI1lhfMckjSgTodQMvo8gP8 yI2c1iixXoJHYwwven2e0dca/+dwQCHYJYia4zIvlNrjP58T/vJwZ9qCfdMMbH+jUwt0 3xbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9y7CqGBN0TOAnxl5iFoh9qAAnZAPUKalhtMJvSXgCMA=; b=t63CNJVhJoN8ICG0U9GxazufifOHaMewUwEg7BBd5ZHud5jXn3vKsk5P9DElegxDkG 4J50mtBKOgkS8/EiCW84wqA1O3ElPe6MZKUh3LV7liIjKAuESK2gYkIWh64cgxb2q/Ww xpiTV8E+mJYZANTtcWy+suKhRJZx26AbUSD18Whxmbfvnc2F0OLc+9uMg7HlArXQ64c/ BwliLWSPuIlO4BQRN12FfgZUtLOgs5oyWGZzOMu9zqOI385H0mAnBDDN5EgHHz3ulc9t Us9JAByg023Tm7/gEqL4aVw2we5zc+VRCVWs8wCxXuxGOZ416aMqStz506h71I4o9h/T SCIg== X-Gm-Message-State: APt69E2dOc6DXr+5cecxcFqv3N7GagnE4mXlXsz0OiUy88DJf6whvZD4 bhrpDPL6d8DKo2O7d2TTHBNXLw== X-Google-Smtp-Source: AAOMgpeT3yPn6S589G6plaJ7JwWPExLCInSgB7F0+h1vgdcWEHi3RKaDCf6H+rj9RT9aK9U+G+hHNQ== X-Received: by 2002:a37:6086:: with SMTP id u128-v6mr10501271qkb.8.1529939588248; Mon, 25 Jun 2018 08:13:08 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id d192-v6sm10414549qkb.46.2018.06.25.08.13.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jun 2018 08:13:07 -0700 (PDT) From: Josef Bacik 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 Message-Id: <20180625151243.2132-16-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180625151243.2132-1-josef@toxicpanda.com> References: <20180625151243.2132-1-josef@toxicpanda.com> 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 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 --- 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;