Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp589745pxb; Wed, 8 Sep 2021 08:01:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOdz8HXt+ib9wjt6I52YAZUBJ+CvGdDmxQ4i5/o+1oPmn2MW8ZovOg6jdxYiYh6bf1TFVl X-Received: by 2002:a05:6402:4404:: with SMTP id y4mr4316148eda.52.1631113262345; Wed, 08 Sep 2021 08:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631113262; cv=none; d=google.com; s=arc-20160816; b=pySqWIKfH+UWSlBnDq4o8NHSMgMWJNo6VTzBoNadbrcYZX6F2ja7nL6nZf2gu4x2wF P0aVsnsBFrOSMjRBQL/AY1HbrgPgG3CBiRlWRj2hAfwAO1eyMwc6h4t1/KDfaPQkqXrG BkyBmnIBYSd9tWNOfiw8IP5UoaAkYHa/T/wpKblo3xr7tIJ+dnOB0b95ekgY1RgIW1Qn SvkSMBbyrRywiNuPH6ySLX/HwiKeGaK1bUy9MgqpfIoFSV4m/Fs0MB3DYfV+dXfOJIF8 G/tOK2Q2LK8q6mUbb6wUJP6UGiD78xy/Ptq3jcnOulskslmXi/UckIjMO/ZzrL10c5PF /Dnw== 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=YXEDz7oYZ9GVUcmsFxgUXf/+gVqKX8tYxel25XnFhQk=; b=dKVCVbCnfM0MN185uheB7DK+NhySK4K3WT8XBIaY593AJxu9H7gbiy063ioKOP1rAb msUcdlTzUCitngmslO4eMTHBy7B9wAioPRJzAUecgEF2fSNfIRwsaRH6doXJnIY2cJ8F aztdVDO3u7ULLUN2RXwAdAXRWvRBMxsWq8penqwRNn88yvKWp/2NXHRngAK+JgHctUJr EE3sfTk8F8pe7J/5V94045hWYwsI62tHhx4nDeKZYib+P62ekA83W0MzTgrcx6OZcyFE j8E8oxhVtXGpuDrJU08+7HYI5HYrYV0BRN2UBE2r6nPBGx7orQhvdP2SI8EC9p8GvxSW lR0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pbjCyzFT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si2410480eds.206.2021.09.08.08.00.38; Wed, 08 Sep 2021 08:01:02 -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=@google.com header.s=20210112 header.b=pbjCyzFT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348814AbhIHOvf (ORCPT + 99 others); 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-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;