From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DED9C433EF for ; Wed, 8 Sep 2021 14:50:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C82E60724 for ; Wed, 8 Sep 2021 14:50:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235726AbhIHOvf (ORCPT ); Wed, 8 Sep 2021 10:51:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238237AbhIHOve (ORCPT ); Wed, 8 Sep 2021 10:51:34 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95D0AC061757 for ; Wed, 8 Sep 2021 07:50:26 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id v10so4816981ybm.5 for ; Wed, 08 Sep 2021 07:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YXEDz7oYZ9GVUcmsFxgUXf/+gVqKX8tYxel25XnFhQk=; b=pbjCyzFTALXr0BXl5ZqQtgWQqC6a1sLiadtnhsMIPnXGTyhzgH5kpweFWU7G6SfwO2 PKPGmPvHs/dIEXV/HSvW73bdIn3P0hovqzS/K2acGseK0vRVcBbsKNl/L7XiTKHawWwA PesH7J1hMvPSSfrXN5Q8DbaxO7JtlmJwEnR84mEdKy3jdcLG+7fpvIGw0INc8nKVi0uL awjKo5K7nYwIlHXDfBzXaqKeTjdP4xznndi20EBb91myipuqd2nUuQ96ZOiPnon6SJU4 Dgm9iB+A0JM4WMK0WhV75KDb+BFZuTGz73TNUufVrrnzN8otT+pUWAW1BKcLl0MF/nte R5GQ== 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=YXEDz7oYZ9GVUcmsFxgUXf/+gVqKX8tYxel25XnFhQk=; b=2c0nFuunOW1aO6VqG/m0+/RS7HMBJnSJbn1AhdZTQYVfRAGfihlKv09r9e2zt2l0Kv vnIUf9NdHd/ETs+1xJQ06HrE40+8zCTjK3A414FDYKamX815VlwAAHnypfVuknZjiEet ijFP8FsNS45Xr0ahgGgKzcb/tVveWSVq/WzF0h7mUxRdYQ0obHhRYWB1ZxCHpLToKwoG Qn2ZV3opaSvUpWE2BznFN6QEyZiMu8ebJndqo04+WLhkG0zclYzLoaPle5lC9XDDcPXK hDZOsiuo9S2yj8et7WuXTIXpqL+Ck+dJhw8+zEGep7/KJrF3GI7ti5diROVnCHPSCqhV AzNA== X-Gm-Message-State: AOAM5301eXhArUO7Qsr9rwgjY064MVkoj8ao8DBIosQOFAfEvtpL4s5X zb5ItClXmNTAkKsvv0M5qHcoujSou5xoaZqPPbWY2A== X-Google-Smtp-Source: ABdhPJz/s/V+QKAdSxOV2bcgwhoA1WXIhjED/O6lwg6Bbxfk8TTcLpRhkZ3HeC7f0kNS2MSsTUihgZ41vrb77ROMIHM= X-Received: by 2002:a25:dd46:: with SMTP id u67mr5486909ybg.295.1631112625292; Wed, 08 Sep 2021 07:50:25 -0700 (PDT) MIME-Version: 1.0 References: <53ce8db-3372-b5e2-cee7-c0ebe9c45a9@tarent.de> In-Reply-To: <53ce8db-3372-b5e2-cee7-c0ebe9c45a9@tarent.de> From: Eric Dumazet Date: Wed, 8 Sep 2021 07:50:13 -0700 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: Thorsten Glaser Cc: Linus Torvalds , 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 6:48 AM Thorsten Glaser wrote: > > On Tue, 7 Sep 2021, Linus Torvalds wrote: > > > The do_tcp_getsockopt() one in tpc.c is a classic case of "lots of > > different case statements, many of them with their own struct > > allocations on stack, and all of them disjoint". > > Any compiler developers here? AFAIK the compiler knows the lifetime > of function-local variables, so why not alias the actual memory > locations and ranges to minimise stack usage? > 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. diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index e8b48df73c852a48e51754ea98b1e08bf024bb9e..437910c096b202420518c9e5e5cd26b2194d8aa2 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2054,9 +2054,10 @@ static void tcp_zc_finalize_rx_tstamp(struct sock *sk, } #define TCP_ZEROCOPY_PAGE_BATCH_SIZE 32 -static int tcp_zerocopy_receive(struct sock *sk, - struct tcp_zerocopy_receive *zc, - struct scm_timestamping_internal *tss) +static noinline_for_stack int +tcp_zerocopy_receive(struct sock *sk, + struct tcp_zerocopy_receive *zc, + struct scm_timestamping_internal *tss) { u32 length = 0, offset, vma_len, avail_len, copylen = 0; unsigned long address = (unsigned long)zc->address;