From patchwork Wed Apr 20 04:27:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12819733 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 F057EC433FE for ; Wed, 20 Apr 2022 04:27:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8238B6B0081; Wed, 20 Apr 2022 00:27:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7AB2C6B0082; Wed, 20 Apr 2022 00:27:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 625EC6B0083; Wed, 20 Apr 2022 00:27:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 483E86B0081 for ; Wed, 20 Apr 2022 00:27:48 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1BA56768 for ; Wed, 20 Apr 2022 04:27:48 +0000 (UTC) X-FDA: 79375974216.11.DA6C7DD Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP id 7C98120002 for ; Wed, 20 Apr 2022 04:27:46 +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=SNly7Jwe/4q/B3a1kzOX1/36o22AU8SRE+zg1tBGQ9U=; b=cOFOqCrQxfWWZaKuWhtRafckeu P+Yum7mHcbB5K/oV23eYNqeC3183rPrqIqW55KINjYuXL5CG9Og5n9Me4So6eoT2Ry+83vwH93DDG +Pwh+AXHhrOAg0FzZ4KdQJJlb1eouiTz5swUSW+9JsCYduE3jPo0UqBkF/XWIKHcUDBbCUIIx5Tev vmfeY3THFOpNEoKVk7mCrh9wYq04q0sWjxqyDmV6ncvHs/4KGkdHhPPMZ5+PG9d53LxMFvTb2w9u0 yWU2ENPumNaX0M+7j4BtfDrl3VxPhOp/31nmimkL+kkBa6AzNQjiIGi56i8yYj+EDm2AJLGIcOBAW Wt2H7B/g==; 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 1nh1wN-007FII-G2; Wed, 20 Apr 2022 04:27:44 +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 05/15] blk-cgroup: move blk_cgroup_congested out line Date: Wed, 20 Apr 2022 06:27:13 +0200 Message-Id: <20220420042723.1010598-6-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7C98120002 X-Stat-Signature: dnkkpx89t765ecfxgiyioa5wt3eig1at Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=cOFOqCrQ; dmarc=none; spf=none (imf13.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 X-HE-Tag: 1650428866-91178 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: There is no urgent need to inline this function, so move it out of line. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 20 ++++++++++++++++++++ include/linux/blk-cgroup.h | 20 +------------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 8dfe62786cd5f..97266ebde975b 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1950,6 +1950,26 @@ void blk_cgroup_bio_start(struct bio *bio) put_cpu(); } +bool blk_cgroup_congested(void) +{ + struct cgroup_subsys_state *css; + bool ret = false; + + rcu_read_lock(); + css = kthread_blkcg(); + if (!css) + css = task_css(current, io_cgrp_id); + while (css) { + if (atomic_read(&css->cgroup->congestion_count)) { + ret = true; + break; + } + css = css->parent; + } + rcu_read_unlock(); + return ret; +} + static int __init blkcg_init(void) { blkcg_punt_bio_wq = alloc_workqueue("blkcg_punt_bio", diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index 7a2f7de30173c..988965c1c27b8 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -135,25 +135,7 @@ static inline struct blkcg *bio_blkcg(struct bio *bio) return NULL; } -static inline bool blk_cgroup_congested(void) -{ - struct cgroup_subsys_state *css; - bool ret = false; - - rcu_read_lock(); - css = kthread_blkcg(); - if (!css) - css = task_css(current, io_cgrp_id); - while (css) { - if (atomic_read(&css->cgroup->congestion_count)) { - ret = true; - break; - } - css = css->parent; - } - rcu_read_unlock(); - return ret; -} +bool blk_cgroup_congested(void); /** * blkcg_parent - get the parent of a blkcg