Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp632272pxb; Wed, 8 Sep 2021 08:50:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLIH/KgK2J4KRnmrmehtkeDJ1Eqn1FhySajMAl+O12aAeNeQ3Y0ZZOn7m0ScwEMw0nFYja X-Received: by 2002:a6b:3c16:: with SMTP id k22mr467379iob.130.1631116256333; Wed, 08 Sep 2021 08:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631116256; cv=none; d=google.com; s=arc-20160816; b=0FMTV0Pp6suZXnfNENmIMGmNnnL8e8K0wZ1/urF/cSErtGS7hTVL6ZP0YU35WM4Q0v R/VxKNUN2iJHROvQ55PQPWHBViETmbawXAbkZ63hxxgP3F/rA2Yvi2M8Xurpc4wp1cTC XiVqMVSMDBZOpwkOvJF2Eaf/870F/4CMn7uf6AFF9JBrW71ms3wb81Ss+YBl8ZLnLS/2 8ft4yYt/HZNLfCg4JAK2xFswBS1bfbHnqwFYeWhr2wleUgQo6dw/skx+7Ew67rSfTxKm ZDYkGs6claZwbtfpXNgemA+adJiiBm/eUkvGzh1XJzZSEgDaSNpArWvXK7hiWsCANupv x7vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PcF296h2+jiTZRH7itaWnGkrpPXNXdTwX29k3fuQ+jc=; b=slQkj4j9rqEiFLZaNxEmphdnwkSDlEOH6QXUdYIoqMdG0pdAHMGQ2K3eKS61rav+2f Q0I01XGhkYtAY5xBBKCJp0AIzw2WgzgbE0IVzkaOu1TCk423cmdAg62yPXEYEeTDDjb/ EBgMS6AWAtwcwCNFQ6RAu8yutor0CKZHYwE+P2QsuvxWSUHkI7qt4bUyHfv1v7c7nA4h wL70aPtaYcnylr4VhLgcErzbScA3BOLROaQVm6sRwPMe8hfdN4jyNc3fvSIxls0fqxjV 4VnxUHU8rtiQE1B9ApmrSrfoSHTPKHXS5Iq2/+JGAgAYF/viy1GG/2j6O81R6STGSj+o 2o0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZwCRqKII; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b17si1583392ilc.122.2021.09.08.08.50.43; Wed, 08 Sep 2021 08:50:56 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZwCRqKII; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349746AbhIHPuP (ORCPT + 99 others); Wed, 8 Sep 2021 11:50:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349633AbhIHPuL (ORCPT ); Wed, 8 Sep 2021 11:50:11 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACCE6C061575 for ; Wed, 8 Sep 2021 08:49:03 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id j12so4273662ljg.10 for ; Wed, 08 Sep 2021 08:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PcF296h2+jiTZRH7itaWnGkrpPXNXdTwX29k3fuQ+jc=; b=ZwCRqKII+z7vKEvFb10WpEzrknavJ+xY91cakvNMvB12ilS1ZXGEroVoZGRbTsMeHX r2zn5SfzXpbQBiUmBwz5flemzUgkqkyaVzmRA0zAl11PDMt+Eapr9rFmLWA3oZAESpPQ tpmQ6lADbmqWjIXc3iG+eXb+QhwWpsNLgETq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PcF296h2+jiTZRH7itaWnGkrpPXNXdTwX29k3fuQ+jc=; b=nKpTwGTOiDYqB71dfBIGXOpCPI5xuNu23joVvJJtmU8yCjc5VI6GmI2AEWGnfL6PjH HvMTFueC8dXSJ4DJQDZJvDyphR388kRj9RZNhRtRBttst2nqTBsCkIpgkD63jDNLQH7w 7Um7QMe3C3U+Xv4s9UJSBobtmeI1MDp6fcdbOqK7x7V7hpFHhUjZMQVb0z9sv60eFAl8 qfVW9z/sFxHfFbA1Q2xH1qemLgJOSh/fFhJgn0TjQ/IhAbfkPNV2FEpxRJJmKvyUfsnM puNDU+wKSzIiASy3pnfj+lz1jQBjk6uo6JU1jXRt5NEqebotiHqFOYf5U8SxVM+3gZ/a RoTA== X-Gm-Message-State: AOAM533eVbren3F8EDT5BK66IFauEnXNvZGDMMMxSmBFik2RUqJ428V0 tx5UZlwV3Bcaq89Dbwhxb0KEJVWJr5EL6Xk5l8I= X-Received: by 2002:a2e:8795:: with SMTP id n21mr3536176lji.474.1631116141586; Wed, 08 Sep 2021 08:49:01 -0700 (PDT) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id a16sm277306ljq.22.2021.09.08.08.48.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Sep 2021 08:48:58 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id k4so5785118lfj.7 for ; Wed, 08 Sep 2021 08:48:58 -0700 (PDT) X-Received: by 2002:a05:6512:114c:: with SMTP id m12mr3186957lfg.150.1631116138014; Wed, 08 Sep 2021 08:48:58 -0700 (PDT) MIME-Version: 1.0 References: <53ce8db-3372-b5e2-cee7-c0ebe9c45a9@tarent.de> In-Reply-To: From: Linus Torvalds Date: Wed, 8 Sep 2021 08:48:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: ipv4/tcp.c:4234:1: error: the frame size of 1152 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] To: Eric Dumazet Cc: Thorsten Glaser , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 8, 2021 at 7:50 AM Eric Dumazet wrote: > > At least on my builds, do_tcp_getsockopt() uses less than 512 bytes of stack. > > Probably because tcp_zerocopy_receive() is _not_ inlined, by pure luck > I suppose. > > Perhaps we should use noinline_for_stack here. I agree that that is likely a good idea, but I also suspect that the stack growth may be related to other issues. So it being less than 512 bytes for you may be related to other random noise than inlining. In the past I've seen at least two patterns (a) not merging stack slots at all (b) some odd "pattern allocator" problems, where I think gcc ended up re-using previous stack slots if they were the right size, but failing when previous allocations were fragmented that (a) thing is what -fconserve-stack is all about, and we also used to have (iirc) -fno-defer-pop to avoid having function call argument stacks stick around. And (b) is one of those "random allocation pattern" things, which depends on the phase of the moon, where gcc ends up treating the stack frame as a series of fixed-size allocations, but isn't very smart about it. Even if some allocations got free'd, they might be surrounded by oithers that didn't, and then gcc wouldn't re-use them if there's a bigger allocation afterwards. And similarly, I don't think gcc ever even joins together two free'd stack frame allocations. I also wouldn't be surprised at all if some of our hardening flags ended up causing the stack frame reuse to entirely fail. IOW, I could easily see things like INIT_STACK_ALL_ZERO might cause the compiler to initialize all the stack frame allocations "early", so that their lifetimes all overlap. So it could easily be about very subtle and random code generation choices that just change the order of allocation. A spill in the wrong place, things like that. Or it could be about not-so-subtle big config option things. Linus