From patchwork Wed Apr 20 04:27:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12819742 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DA8FC43217 for ; Wed, 20 Apr 2022 04:28:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 982466B0093; Wed, 20 Apr 2022 00:28:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 90A856B0095; Wed, 20 Apr 2022 00:28:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AC346B0096; Wed, 20 Apr 2022 00:28:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 663426B0093 for ; Wed, 20 Apr 2022 00:28:14 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 47E01256AC for ; Wed, 20 Apr 2022 04:28:14 +0000 (UTC) X-FDA: 79375975308.24.E4DEC09 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf30.hostedemail.com (Postfix) with ESMTP id 4044D80016 for ; Wed, 20 Apr 2022 04:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=xmlR5HUFOAI8yqQFKY2MjEXGwXGx785pMDVfAqM57ow=; b=LMiuO+Sz6pZtEd/3zHUKL+74hk RpDt274l1HCMYrW1VFhdZfv9C/v4MJmcABLxfjJSnH1xD1FymXQDAiM1XRKJ0bfzpPnyq6JA7vTsJ U6ighNPhZ6WMln3DZRgZGB8IrKD8jsHv7+Zcz+q/n0qQb8Qln1SRuvSUhu8rnPRAO4NkoUS+IYw5E UpWlcjxj53dat92wmf8kUZLE+5nDicqZ1JW7ngiAfEgWoQyG34+GlzY5iwkasD8PrBCyhI7EY/6c5 UV72fx2cclo9+GXOvxhux5g04dBiY3tCpN9Axb2GlbCQepBEpSDQCvzIUQQJTy26JU9m0aKkIi0li OvH2sV+w==; Received: from 089144220023.atnat0029.highway.webapn.at ([89.144.220.23] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh1wo-007FfR-41; Wed, 20 Apr 2022 04:28:10 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Paolo Valente , Tejun Heo , James Smart , Dick Kennedy , linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-nvme@lists.infradead.org, linux-mm@kvack.org Subject: [PATCH 14/15] blk-cgroup: cleanup blkcg_maybe_throttle_current Date: Wed, 20 Apr 2022 06:27:22 +0200 Message-Id: <20220420042723.1010598-15-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220420042723.1010598-1-hch@lst.de> References: <20220420042723.1010598-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 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4044D80016 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=LMiuO+Sz; spf=none (imf30.hostedemail.com: domain of BATV+4b42fcde86a6810335df+6814+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+4b42fcde86a6810335df+6814+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-Stat-Signature: 7b74w1ukp51rtmqwd5sseymd3o5sgufp X-HE-Tag: 1650428892-314112 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use blkcg_css instead of opencoding it. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 5684a8ce1f755..a91f8ae18b49b 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1808,7 +1808,6 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) void blkcg_maybe_throttle_current(void) { struct request_queue *q = current->throttle_queue; - struct cgroup_subsys_state *css; struct blkcg *blkcg; struct blkcg_gq *blkg; bool use_memdelay = current->use_memdelay; @@ -1820,12 +1819,7 @@ void blkcg_maybe_throttle_current(void) current->use_memdelay = false; rcu_read_lock(); - css = kthread_blkcg(); - if (css) - blkcg = css_to_blkcg(css); - else - blkcg = css_to_blkcg(task_css(current, io_cgrp_id)); - + blkcg = css_to_blkcg(blkcg_css()); if (!blkcg) goto out; blkg = blkg_lookup(blkcg, q);