From patchwork Tue Jul 31 16:39:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10551057 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 4CC6913BB for ; Tue, 31 Jul 2018 16:39:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E8AE2AFF1 for ; Tue, 31 Jul 2018 16:39:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 316682B020; Tue, 31 Jul 2018 16:39:12 +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=ham 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 D390B2AFF1 for ; Tue, 31 Jul 2018 16:39:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727495AbeGaSUS (ORCPT ); Tue, 31 Jul 2018 14:20:18 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:38732 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbeGaSUS (ORCPT ); Tue, 31 Jul 2018 14:20:18 -0400 Received: by mail-qk0-f193.google.com with SMTP id 126-v6so10670304qke.5 for ; Tue, 31 Jul 2018 09:39:10 -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=U8Xb3NV+V9zRWRUjwIItut9NuPjFnKqSu+91N/OFlys=; b=u2bCMyaHjlJQOBcXa84m0GsY2tSguLs+awJWLx4iGISlCLop/uTS0q0vnNPOP/BJLb TJPl9MprXxNNLYBX+fc7TnowvVYT/LWqP0e2aJpPLwXOyqJ9B0iX6oKSY1DKBSx62Qqr SulgVVji8VQuJclSYPzgjY0HRWZElhoErzSTIFCo1LlANNBXfj/YVqitu2Wq94i6akZz pngh/BlrtdlURsv6DkSLwdtZ94yWP2X0JyfoT8ZYz8e1THmlydhQQXk2vWSRSrxkZO+H GPJ72HqU5lC19TNeqUfRbe3Glad3NogluMY/syF0sCiIMfLY/TlcyVwYnHZmAvpN0jAO Dx4A== 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=U8Xb3NV+V9zRWRUjwIItut9NuPjFnKqSu+91N/OFlys=; b=HtjshGtkinZqFpYHeuDF8GHFSzESRJzvohXKs9r4002aZec5RLTLA/vbTbP7Jh+PRI Np42/xQf7DGHL8yHjEgrj7UERJBem/AU2tJAGx8kSIq9BjbjuVJynOniEAdGNTRf4hsk NtIHr4X1g8djOSR+SqPyf+aBgcTU8DrVm7kA91SuZ7uPj/RC3CekkShdqXQfoQHIRxNN kOEw21+MXE7lam9xOoSkuUtPCcJ4e0SuZe6cnCpBP8yeMJ7CFih7MEf/0QowxEy8zlYm V6R67ENcBQ98eVyGBLDDunkfGsEFmw85Q48UVNVjMeOK33L7Yi5ThpJ557+8aDF5xzOv kgqg== X-Gm-Message-State: AOUpUlFESxvfqCg0aPhMmiJHPVVWMqD8gTO1JKinq7K12UdTxABU/MmE etebDlwQj7lZw2hX8UtZJGzrGejOhT4= X-Google-Smtp-Source: AAOMgpf04IDzxCAmL8OMiDBZC3uCdiraJ+7viK+73dwsDJFEDtHxQZ9sV4O7o/8zqjdUrxlY99VfnQ== X-Received: by 2002:a37:188c:: with SMTP id 12-v6mr20883856qky.72.1533055150480; Tue, 31 Jul 2018 09:39:10 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id o2-v6sm9208234qte.16.2018.07.31.09.39.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Jul 2018 09:39:09 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 2/3] blk-cgroup: hold the queue ref during throttling Date: Tue, 31 Jul 2018 12:39:03 -0400 Message-Id: <20180731163904.21856-3-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180731163904.21856-1-josef@toxicpanda.com> References: <20180731163904.21856-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 The blkg lifetime is protected by the queue lifetime, so we need to put the queue _after_ we're done using the blkg. Signed-off-by: Josef Bacik --- block/blk-cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 1942357d7165..694595b29b8f 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1759,10 +1759,10 @@ void blkcg_maybe_throttle_current(void) if (!blkg) goto out; rcu_read_unlock(); - blk_put_queue(q); blkcg_maybe_throttle_blkg(blkg, use_memdelay); blkg_put(blkg); + blk_put_queue(q); return; out: rcu_read_unlock();