mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
	vgoyal@redhat.com, avanzini.arianna@gmail.com
Subject: [PATCH 11/10] blkcg: reduce stack usage of blkg_rwstat_recursive_sum()
Date: Thu, 16 Jul 2015 11:55:02 -0400	[thread overview]
Message-ID: <20150716155502.GW15934@mtj.duckdns.org> (raw)
In-Reply-To: <1436724043-12986-1-git-send-email-tj@kernel.org>

>From 8c6417cb56c71efd47d28d15bc117567f3171c93 Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Thu, 16 Jul 2015 11:50:49 -0400

The recent percpu conversion of blkg_rwstat triggered the following
warning in certain configurations.

 block/blk-cgroup.c:654:1: warning: the frame size of 1360 bytes is larger than 1024 bytes

This is because blkg_rwstat now contains four percpu_counter which can
be pretty big depending on debug options although it shouldn't be a
problem in production configs.  This patch removes one of the two
local blkg_rwstat variables used by blkg_rwstat_recursive_sum() to
reduce stack usage.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Link: http://article.gmane.org/gmane.linux.kernel.cgroups/13835
---
Hello,

One extra patch to deal with stack usage bloat under debug configs
which came with percpu_counter conversion.  git branch updated
accordingly.

Thanks.

 block/blk-cgroup.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 2469a65..0d5b8b8 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -744,7 +744,7 @@ struct blkg_rwstat blkg_rwstat_recursive_sum(struct blkcg_gq *blkg,
 
 	rcu_read_lock();
 	blkg_for_each_descendant_pre(pos_blkg, pos_css, blkg) {
-		struct blkg_rwstat *rwstat, tmp;
+		struct blkg_rwstat *rwstat;
 
 		if (!pos_blkg->online)
 			continue;
@@ -754,12 +754,10 @@ struct blkg_rwstat blkg_rwstat_recursive_sum(struct blkcg_gq *blkg,
 		else
 			rwstat = (void *)pos_blkg + off;
 
-		tmp = blkg_rwstat_read(rwstat);
-
 		for (i = 0; i < BLKG_RWSTAT_NR; i++)
-			atomic64_add(atomic64_read(&tmp.aux_cnt[i]) +
-				     atomic64_read(&rwstat->aux_cnt[i]),
-				     &sum.aux_cnt[i]);
+			atomic64_add(atomic64_read(&rwstat->aux_cnt[i]) +
+				percpu_counter_sum_positive(&rwstat->cpu_cnt[i]),
+				&sum.aux_cnt[i]);
 	}
 	rcu_read_unlock();
 
-- 
2.4.3


      parent reply	other threads:[~2015-07-16 15:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 18:00 [PATCHSET v2 block/for-4.3] blkcg: blkcg stats cleanup Tejun Heo
2015-07-12 18:00 ` [PATCH 01/10] cgroup: make cftype->private a unsigned long Tejun Heo
2015-08-11 17:36   ` Tejun Heo
2015-07-12 18:00 ` [PATCH 02/10] blkcg: inline [__]blkg_lookup() Tejun Heo
2015-07-12 18:00 ` [PATCH 03/10] blkcg: move root blkg lookup optimization from throtl_lookup_tg() to __blkg_lookup() Tejun Heo
2015-07-12 18:00 ` [PATCH 04/10] blk-throttle: improve queue bypass handling Tejun Heo
2015-07-12 18:00 ` [PATCH 05/10] blkcg: consolidate blkg creation in blkcg_bio_issue_check() Tejun Heo
2015-07-15 22:39   ` [PATCH v2 " Tejun Heo
2015-07-12 18:00 ` [PATCH 06/10] blkcg: add blkg_[rw]stat->aux_cnt and replace cfq_group->dead_stats with it Tejun Heo
2015-07-12 18:00 ` [PATCH 07/10] blkcg: make blkcg_[rw]stat per-cpu Tejun Heo
2015-07-12 18:00 ` [PATCH 08/10] blkcg: make blkg_[rw]stat_recursive_sum() to be able to index into blkcg_gq Tejun Heo
2015-07-12 18:00 ` [PATCH 09/10] blkcg: move io_service_bytes and io_serviced stats " Tejun Heo
2015-07-14 16:09   ` Vivek Goyal
2015-07-15 16:04     ` Tejun Heo
2015-07-15 16:29       ` Vivek Goyal
2015-07-15 16:53         ` Tejun Heo
2015-07-15 22:40   ` [PATCH v3 " Tejun Heo
2015-07-12 18:00 ` [PATCH 10/10] blkcg: remove cfqg_stats->sectors Tejun Heo
2015-07-16 15:55 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150716155502.GW15934@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=avanzini.arianna@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome