From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751343AbdISD1A (ORCPT ); Mon, 18 Sep 2017 23:27:00 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:37803 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbdISD07 (ORCPT ); Mon, 18 Sep 2017 23:26:59 -0400 X-Google-Smtp-Source: AOwi7QBbiSJCv9c9C7nacs98ieb2zlyiDZW0xLDFlNpD2xY+b2nGjk2Y41ZazLKbtRh/uzqFJ3pfqA== Date: Mon, 18 Sep 2017 20:26:55 -0700 From: Tejun Heo To: Arnd Bergmann Cc: Jens Axboe , Tahsin Erdogan , Bart Van Assche , Shaohua Li , Nikolay Borisov , linux-kernel@vger.kernel.org Subject: Re: [PATCH] blkcg: simplify statistic accumulation code Message-ID: <20170919032655.GO378890@devbig577.frc2.facebook.com> References: <20170915193647.1102621-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170915193647.1102621-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 15, 2017 at 09:36:21PM +0200, Arnd Bergmann wrote: > Some older compilers (gcc-4.4 through 4.6 in particular) struggle > with the way that blkg_rwstat_read() returns a structure, leading > to excessive stack usage and rather inefficient code: > > block/blk-cgroup.c: In function 'blkg_destroy': > block/blk-cgroup.c:354:1: error: the frame size of 1296 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > block/cfq-iosched.c: In function 'cfqg_stats_add_aux': > block/cfq-iosched.c:753:1: error: the frame size of 1928 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > block/bfq-cgroup.c: In function 'bfqg_stats_add_aux': > block/bfq-cgroup.c:299:1: error: the frame size of 1928 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > I also notice that there is no point in using atomic accesses > for the local variables, so storing the temporaries in simple 'u64' > variables not only avoids the stack usage on older compilers but > also improves the object code on modern versions. > > Fixes: e6269c445467 ("blkcg: add blkg_[rw]stat->aux_cnt and replace cfq_group->dead_stats with it") > Signed-off-by: Arnd Bergmann Acked-by: Tejun Heo Thanks. -- tejun