diff options
author | Tejun Heo <tj@kernel.org> | 2015-08-18 17:55:26 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-08-18 18:49:18 -0400 |
commit | 3a7faeada20d72f07d3a7b13454859025cd50a36 (patch) | |
tree | 01dc2b90eab2db6680d1f433c130e57351ee281c | |
parent | 702747cabe737fe9b358739443d539f10cc7c715 (diff) |
blkcg: reduce stack usage of blkg_rwstat_recursive_sum()
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
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | block/blk-cgroup.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index a25263ca39ca..c82c5dbf9187 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, | |||
744 | 744 | ||
745 | rcu_read_lock(); | 745 | rcu_read_lock(); |
746 | blkg_for_each_descendant_pre(pos_blkg, pos_css, blkg) { | 746 | blkg_for_each_descendant_pre(pos_blkg, pos_css, blkg) { |
747 | struct blkg_rwstat *rwstat, tmp; | 747 | struct blkg_rwstat *rwstat; |
748 | 748 | ||
749 | if (!pos_blkg->online) | 749 | if (!pos_blkg->online) |
750 | continue; | 750 | continue; |
@@ -754,12 +754,10 @@ struct blkg_rwstat blkg_rwstat_recursive_sum(struct blkcg_gq *blkg, | |||
754 | else | 754 | else |
755 | rwstat = (void *)pos_blkg + off; | 755 | rwstat = (void *)pos_blkg + off; |
756 | 756 | ||
757 | tmp = blkg_rwstat_read(rwstat); | ||
758 | |||
759 | for (i = 0; i < BLKG_RWSTAT_NR; i++) | 757 | for (i = 0; i < BLKG_RWSTAT_NR; i++) |
760 | atomic64_add(atomic64_read(&tmp.aux_cnt[i]) + | 758 | atomic64_add(atomic64_read(&rwstat->aux_cnt[i]) + |
761 | atomic64_read(&rwstat->aux_cnt[i]), | 759 | percpu_counter_sum_positive(&rwstat->cpu_cnt[i]), |
762 | &sum.aux_cnt[i]); | 760 | &sum.aux_cnt[i]); |
763 | } | 761 | } |
764 | rcu_read_unlock(); | 762 | rcu_read_unlock(); |
765 | 763 | ||