Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7004883ybi; Mon, 22 Jul 2019 05:32:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRVETBggzf9DbYWZSTQc591ywugh+ic21A1vEp/0DH0hDpCgtGpcWLQj+6/i6afqT04wG5 X-Received: by 2002:a63:460c:: with SMTP id t12mr70987723pga.69.1563798749960; Mon, 22 Jul 2019 05:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563798749; cv=none; d=google.com; s=arc-20160816; b=B95bp5+ySyF8D+IHrqlAJ5jaeRTy4INN210Ym/vhI608NisaqyO6AxG/9uSyd95M8Z xbq3M0ZG1p4mIR35YNzmdvHXzOr7fiyMUOdvVcrc15eQQ4ofsvHX0up/d2D1MqGkI2hb MdsI+OZ8HNUJ1S7Z791PVWQQb1B35K6Ls3YyDolsuz0gnU6YnoNLmjqff/sWSVITuYE8 daCIWTZ3qykcUE2vpIlHDEWu60PsoGrDwjqxHiDztFltHoWh9WcyEhuiRRmVFX0j2lfO HqrqD6ERxiDoYRQVKkUy48jAAAB70QKomuuvKKnmy5u+sn4CPJ+8yTlMe7qplOWGAG/Y y/vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=0NOGeJyfbedSFMqRuTXzJhGJqhWVTfys7Td6+TiU9cU=; b=YtJhZbQ5kuQnHOBVY2bk6ECaZwL1ljJx7kPFeAhHQxN0V1PA8pLVFRQyKEB/IZ5nnn TRwJwA7y7x6Pe/TsyKSd8glYj3eVox2H/w5p/0go+v7b3VPdn2wMXIgf7gydYTUAfMzk g5N+eDRp2fBK0QjSS1UAnTMfnnF1zklHvA3u/4fy0b63w03QqC4UGQbHzRcyKeDeuAAE +dGsUcVJsvgnxlqBeK+k3GJ8SBGDopLbDxewcr7ovN7GRMNkys+eeYC6AXpXSMuhtp3K Z6NciLDba+W8Jv3ubCIsKtOVkrGSeE8xV03ybwBRIbIW201q6ums8HX+hArHMuKhxCNG w4rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20si9078848pgm.192.2019.07.22.05.32.13; Mon, 22 Jul 2019 05:32:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728493AbfGVK3R (ORCPT + 99 others); Mon, 22 Jul 2019 06:29:17 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:37606 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbfGVK3R (ORCPT ); Mon, 22 Jul 2019 06:29:17 -0400 Received: by mail-qk1-f195.google.com with SMTP id d15so28154034qkl.4; Mon, 22 Jul 2019 03:29:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0NOGeJyfbedSFMqRuTXzJhGJqhWVTfys7Td6+TiU9cU=; b=K9uw9O5KERcJQL7dKmdtVhuZ5e+o96+Y/S4EABKI+CBZOfQIqgBp7xWcl0Lj/Oib/W GcmWRhPF+Q5Uomtr95zpT9Od9UfXi12fSG6l+AA1209kNZezzO1B1a0pGYCS7L2UovzD Sa+A7OZuDvzIUtpaNvTWwKHovS71pZPj6y/wEHH46rJFUOgRu8n8nbuGVltJTnFvXZ21 KpQ/nPHxsVm10rW1/YqqcuF9nrfqc6EZ6IkyYO1Gk+wkrn+owzEgP7BzzAX9cqeeCkvt TUxjhyUJCFAanXYukj6jXuPfCsAhCUN9+6F5LoMniozVZ/G5yye0liv6G8PSULg4CEZI wBMQ== X-Gm-Message-State: APjAAAX0t54w8cC5J7EMC/rHgrbjZdQbjAhN+HcwsR1w3Rl5UrwyGul0 Puj6Xtk7LnOySnh29PnpKdcdCZH4evj/AyQbwz4= X-Received: by 2002:a37:4ac3:: with SMTP id x186mr44393855qka.138.1563791355964; Mon, 22 Jul 2019 03:29:15 -0700 (PDT) MIME-Version: 1.0 References: <20190628123819.2785504-1-arnd@arndb.de> <20190628123819.2785504-4-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Mon, 22 Jul 2019 12:28:59 +0200 Message-ID: Subject: Re: [PATCH 4/4] ipvs: reduce kernel stack usage To: Willem de Bruijn Cc: Kees Cook , Wensong Zhang , Simon Horman , Julian Anastasov , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , James Smart , Dick Kennedy , "James E . J . Bottomley" , "Martin K . Petersen" , Larry Finger , Florian Schilhabel , Greg Kroah-Hartman , James Morris , linux-scsi , linux-kernel , driverdevel , Network Development , lvs-devel@vger.kernel.org, netfilter-devel , coreteam@netfilter.org, Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 28, 2019 at 9:59 PM Willem de Bruijn wrote: > On Fri, Jun 28, 2019 at 8:40 AM Arnd Bergmann wrote: > > > > With the new CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL option, the stack > > usage in the ipvs debug output grows because each instance of > > IP_VS_DBG_BUF() now has its own buffer of 160 bytes that add up > > rather than reusing the stack slots: > > > > net/netfilter/ipvs/ip_vs_core.c: In function 'ip_vs_sched_persist': > > net/netfilter/ipvs/ip_vs_core.c:427:1: error: the frame size of 1052 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > net/netfilter/ipvs/ip_vs_core.c: In function 'ip_vs_new_conn_out': > > net/netfilter/ipvs/ip_vs_core.c:1231:1: error: the frame size of 1048 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > net/netfilter/ipvs/ip_vs_ftp.c: In function 'ip_vs_ftp_out': > > net/netfilter/ipvs/ip_vs_ftp.c:397:1: error: the frame size of 1104 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > net/netfilter/ipvs/ip_vs_ftp.c: In function 'ip_vs_ftp_in': > > net/netfilter/ipvs/ip_vs_ftp.c:555:1: error: the frame size of 1200 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > > > Since printk() already has a way to print IPv4/IPv6 addresses using > > the %pIS format string, use that instead, > > since these are sockaddr_in and sockaddr_in6, should that have the 'n' > specifier to denote network byteorder? I double-checked the implementation, and don't see that make any difference, as 'n' is the default. > > include/net/ip_vs.h | 71 +++++++++++++++++++-------------- > > net/netfilter/ipvs/ip_vs_core.c | 44 ++++++++++---------- > > net/netfilter/ipvs/ip_vs_ftp.c | 20 +++++----- > > 3 files changed, 72 insertions(+), 63 deletions(-) > > > > diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h > > index 3759167f91f5..3dfbeef67be6 100644 > > --- a/include/net/ip_vs.h > > +++ b/include/net/ip_vs.h > > @@ -227,6 +227,16 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, > > sizeof(ip_vs_dbg_buf), addr, \ > > &ip_vs_dbg_idx) > > > > +#define IP_VS_DBG_SOCKADDR4(fam, addr, port) \ > > + (struct sockaddr*)&(struct sockaddr_in) \ > > + { .sin_family = (fam), .sin_addr = (addr)->in, .sin_port = (port) } > > might as well set .sin_family = AF_INET here and AF_INET6 below? That would work just same, but I don't see any advantage. As the family and port members are the same between sockaddr_in and sockaddr_in6, the compiler can decide to set these regardless to the argument values regardless of the condition. Arnd