From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbbGLSCt (ORCPT ); Sun, 12 Jul 2015 14:02:49 -0400 Received: from mail-yk0-f193.google.com ([209.85.160.193]:34955 "EHLO mail-yk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbbGLSAu (ORCPT ); Sun, 12 Jul 2015 14:00:50 -0400 From: Tejun Heo To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, vgoyal@redhat.com, avanzini.arianna@gmail.com, Tejun Heo Subject: [PATCH 03/10] blkcg: move root blkg lookup optimization from throtl_lookup_tg() to __blkg_lookup() Date: Sun, 12 Jul 2015 14:00:36 -0400 Message-Id: <1436724043-12986-4-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1436724043-12986-1-git-send-email-tj@kernel.org> References: <1436724043-12986-1-git-send-email-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, both throttle and cfq policies implement their own root blkg (blkcg_gq) lookup fast path. This patch moves root blkg optimization from throtl_lookup_tg() to __blkg_lookup(). cfq-iosched currently doesn't use blkg_lookup() but will be converted and drop the optimization too. Signed-off-by: Tejun Heo Cc: Vivek Goyal Cc: Arianna Avanzini --- block/blk-throttle.c | 7 ------- include/linux/blk-cgroup.h | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index c2c7547..1f63fc8 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -452,13 +452,6 @@ static void throtl_pd_reset_stats(struct blkg_policy_data *pd) static struct throtl_grp *throtl_lookup_tg(struct throtl_data *td, struct blkcg *blkcg) { - /* - * This is the common case when there are no blkcgs. Avoid lookup - * in this case - */ - if (blkcg == &blkcg_root) - return td_root_tg(td); - return blkg_to_tg(blkg_lookup(blkcg, td->queue)); } diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index d5b54aa..0609bce 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -249,6 +249,9 @@ static inline struct blkcg_gq *__blkg_lookup(struct blkcg *blkcg, { struct blkcg_gq *blkg; + if (blkcg == &blkcg_root) + return q->root_blkg; + blkg = rcu_dereference(blkcg->blkg_hint); if (blkg && blkg->q == q) return blkg; -- 2.4.3