Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp366347pxb; Wed, 8 Sep 2021 03:05:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdOVtXepZoHGvzK3Qj+vced41lTav8SezzfdW9EciRVOTFVL8G8prhphVJoWllFyFjMfCT X-Received: by 2002:a05:6e02:1645:: with SMTP id v5mr2205488ilu.322.1631095558553; Wed, 08 Sep 2021 03:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631095558; cv=none; d=google.com; s=arc-20160816; b=C+6Y+uL53cL/COT9S0R3DH+llIOApxePQPmYML+wFps0tRLTdirioJX+0B2ut8CuWB lUqHsuhz9hj59iS9cAX/RoyPXWQjlgy+Cc7LZhF8UB+VrHdS3rlKX+gUtJOHzhFZTJ2e ki3I00IkOKp/oSSWljSP+cOiJ0s5yYunohE8yWVJlXafmODUFQO2KBidGUsLEcDBnhi6 bQpzzNbrY4wf5FB423qNFu4Pwe+/QWwLAaIm7gWXYzUpPIAmFYb6rsFC1teM1SceGqXr 4Z8Xvdj57Ibw1725s4oLqNX7kRI+hE1pY3se64zQDQoSWaq3ILkQ923K8WFQ2D+4Uqm3 +S0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=bppKmbeT5omixDkAwV5VX75Oyw3uE5XXr6lcDeM/RCw=; b=uOC5ESTYfHA7FDTd8Ygspofj1+UmiyepyVM91WG5ryVBajHvsnck/89PorLLkUsmFY 0t1Vr3ZfM1yVYHo2dpmJUbIKo0a3O3sUOVV5Kmzm0T793z5TxnVCpgXJUuaiFxuEibOJ T3jWcdGKjtMGltFjiqEB6ZnuucWNNGj2uImzkkd0B/HzQv17zRFSyeonebQJdV2jKCU8 4jWEPqANSfCm6W3cjo9q6m0llxCx2gEZiZSXBOKqOLAqke2wqk+O13vd1z3JtUk8V764 dlmydWDgRuQpnkfdj5tuWZjh33vEkDPf7rXgc8f4Hirhlg1Dj2edyviFZzSRa+L2Ctyy oeYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l39si1546606jac.108.2021.09.08.03.05.47; Wed, 08 Sep 2021 03:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbhIHKEn (ORCPT + 99 others); Wed, 8 Sep 2021 06:04:43 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:45888 "EHLO mail-wr1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232259AbhIHKEP (ORCPT ); Wed, 8 Sep 2021 06:04:15 -0400 Received: by mail-wr1-f41.google.com with SMTP id n5so2348720wro.12; Wed, 08 Sep 2021 03:03:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bppKmbeT5omixDkAwV5VX75Oyw3uE5XXr6lcDeM/RCw=; b=xcbX9Dyg3+xFkD2aiVwosIlG4MtzaAbD7QHPye1eqk1OwhhwWLGUi+/Rgig0BWGUza lGY/nF4CID2ijgtXHCGES/Go1YsYwDjTE4KvfPWM1M0h+1M8B893bxY1/jpiKznRAnr7 4KvwAHBGbBC2T6KyuHJZ7d4sYmVNxoTZE1nT0bk2+obzDNsM5jsh+QJKiiUBmSsSbj9/ 9SM/1TOf5BU51zNnUUOMBtT3dqYatS84sKSNl44PqVc7jhM2OPP8sCCiG0XLfKSprkZz gsvYSNjIr940Y+HGI9tltuQze6576m28nuIhGzCejdGZtLeOJL4FUBEw3PzlJynaitKf xpZQ== X-Gm-Message-State: AOAM531RWe2j7nC9KrRNIJmL4wKim3jv/phfs8zmj19jvR2Nw5tQModC cGY9EE2N+6bxqRFts9xW9Ymx1ofHvWE= X-Received: by 2002:adf:ea90:: with SMTP id s16mr3040095wrm.235.1631095386823; Wed, 08 Sep 2021 03:03:06 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id x11sm1648796wro.83.2021.09.08.03.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 03:03:06 -0700 (PDT) Date: Wed, 8 Sep 2021 10:03:04 +0000 From: Wei Liu To: Linus Torvalds Cc: Naresh Kamboju , Mathias Nyman , Johannes Berg , Jakub Kicinski , Shuah Khan , Brendan Higgins , Ariel Elior , GR-everest-linux-l2@marvell.com, Wei Liu , Linux ARM , open list , Netdev , lkft-triage@lists.linaro.org, Arnd Bergmann , "David S. Miller" , Greg Kroah-Hartman , Nick Desaulniers , Nathan Chancellor , Daniel Borkmann , Alexei Starovoitov , Eric Dumazet Subject: Re: ipv4/tcp.c:4234:1: error: the frame size of 1152 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Message-ID: <20210908100304.oknxj4v436sbg3nb@liuwe-devbox-debian-v2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 07, 2021 at 04:14:24PM -0700, Linus Torvalds wrote: > [ Added maintainers for various bits and pieces, since I spent the > time trying to look at why those bits and pieces wasted stack-space > and caused problems ] > > On Tue, Sep 7, 2021 at 3:16 PM Linus Torvalds > wrote: [...] > > There are many more of these cases. I've seen Hyper-V allocate 'struct > cpumask' on the stack, which is once again an absolute no-no that > people have apparently just ignored the warning for. When you have > NR_CPUS being the maximum of 8k, those bits add up, and a single > cpumask is 1kB in size. Which is why you should never do that on > stack, and instead use ' > > cpumask_var_t mask; > alloc_cpumask_var(&mask,..) > > which will do a much more reasonable job. But the reason I call out > hyperv is that as far as I know, hyperv itself doesn't actually > support 8192 CPU's. So all that apic noise with 'struct cpumask' that > uses 1kB of data when NR_CPUS is set to 8192 is just wasted. Maybe I'm > wrong. Adding hyperv people to the cc too. > > A lot of the stack frame size warnings are hidden by the fact that our > default value for warning about stack usage is 2kB for 64-bit builds. > > Probably exactly because people did things like that cpumask thing, > and have these arrays of structures that are often even bigger in the > 64-bit world. > Thanks for the heads-up. I found one instance of this bad practice in hv_apic.c. Presumably that's the one you were referring to. However calling into the allocator from that IPI path seems very heavy weight. I will discuss with fellow engineers on how to fix it properly. Wei. > Linus