From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbcAVIHd (ORCPT ); Fri, 22 Jan 2016 03:07:33 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:17773 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbcAVIH2 (ORCPT ); Fri, 22 Jan 2016 03:07:28 -0500 Message-ID: <56A1E301.2080409@huawei.com> Date: Fri, 22 Jan 2016 16:06:25 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Peter Zijlstra CC: , Subject: Re: [PATCH] perf core: Get rid of 'uses dynamic stack allocation' warning References: <1453445521-230804-1-git-send-email-wangnan0@huawei.com> <20160122080004.GN6357@twins.programming.kicks-ass.net> In-Reply-To: <20160122080004.GN6357@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56A1E306.0147,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1634a19e9994317dfd874b1f6c62cf07 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/1/22 16:00, Peter Zijlstra wrote: > On Fri, Jan 22, 2016 at 06:52:01AM +0000, Wang Nan wrote: >> On s390 with CONFIG_WARN_DYNAMIC_STACK set, 'uses dynamic stack >> allocation' warning is issued when defining 'struct perf_sample_data' >> local variable. >> >> This patch suppress this warning by allocating extra 255 bytes and >> compute aligned pointer manually. > I've seen the warning and always wondered wtf it was about. This > Changelog doesn't actually explain what the problem is, so I cannot > judge the solution. > > That said, 255 extra bytes does sound excessive just to avoid a warn. OK. Then I happly ignore it. I also don't know the exact reason. I guess it related to the ____cacheline_aligned decorator after 'struct perf_sample_data'. When allocating that structure on the stack, kernel has to dynamically compute the stack size it need to satisify the alignment constrain. My patch does this work manually. Thank you.