Message ID | cover.1697989543.git.ozlinuxc@gmail.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp837981vqx; Sun, 22 Oct 2023 09:20:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFN8KvIZoJXfBTfncI3qBECHYyWrIBzJjMT+2s3QJOHp37Jygz9QPGz93hcy8FXPLqtpLlX X-Received: by 2002:a05:6a20:258e:b0:17e:2afd:4087 with SMTP id k14-20020a056a20258e00b0017e2afd4087mr564794pzd.56.1697991620042; Sun, 22 Oct 2023 09:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697991620; cv=none; d=google.com; s=arc-20160816; b=RydxyCz74PUTMEnOzlTeXCzdfC6xSt0706f8av3w2c5oIzQYY2eHo9dvcF8wYKBA9k zRUbWyDRKJIL/fQgDr1wg42WCKcwrA2iU9LbrDvG4HEND1mi2xnfmbv0y/o9D6CfLCzB 2adGUIVsVARMofof5ZJId2wnOvrOGHtZr+gaIknD/p94dIRUPrcEEBYzmCb1vSbYhtTQ 1vpJgBZ5pdBgghRDdmqqDN9FXL30FDi92BpNeKH+50kHVbPP6Gtn41NhT1XrhMOIFBIV zPPN/0DL7seIcpb4VMrnfolgniYGW6V9MOr4dvndTCjRNbglPUsAahkpEE1/JVSbNkz1 yWDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=ot75iBZaZUeJ5MEWunC8jIOcs8JwsIEUJRHg5ojxiKo=; fh=GKuCftXWVuD2V02qa8+3+sB56hLITty73r2bEYgwwVo=; b=NeiOFO4Ijui9NAhXrwhwsqjovzp2x0NILhdSKI5aZWYo8UlRYEkyRVdKY031QeTtNb /jhkKdUNsOqV/uvAWl4s/Urqvn4O4tWlvak0h1y0ygsc6SvyvYM0NZyAHNWm2furYgEd lpCRNNlJ/vUyleB4Ot/gQgR/l+0syqcHeshjPOW5slVi4yt4O5TNUb3lhEMiiKZPZvGt em5+hgYQkh5SPToHAFG4Xb8lUym086Ir3wzlhN/BS5TmTSlvOCYz25gKwGUQKtCpgoIA 7fhBls6CLfiGj5EzuIwEyrFWkByJLZNzjc2kb/LuGT8lnYP5PnL+kk8QUjokemZKG7Ok 7AUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YN1BFlhE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j11-20020a17090a94cb00b00278f5fad9b6si7638427pjw.139.2023.10.22.09.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 09:20:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YN1BFlhE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A31548056A2D; Sun, 22 Oct 2023 09:20:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232370AbjJVQUB (ORCPT <rfc822;a1648639935@gmail.com> + 27 others); Sun, 22 Oct 2023 12:20:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232282AbjJVQUA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 22 Oct 2023 12:20:00 -0400 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F00E1; Sun, 22 Oct 2023 09:19:58 -0700 (PDT) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-57d086365f7so1584190eaf.0; Sun, 22 Oct 2023 09:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697991598; x=1698596398; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=ot75iBZaZUeJ5MEWunC8jIOcs8JwsIEUJRHg5ojxiKo=; b=YN1BFlhEJnsQms0aNNnwx6W3lInmO+aVGqbQ4UnPVIasWyM0pZOLB/dEpFIMVH6ZQU DCq3OADVV1ed/QDEESv5NcDTUKHm3o81iDU444QUAasgVeGye02FijAoWBzbDrCWhVlP Fo0bMvC6RT9St2cZmhYB4VFOosyr0METtY82zWYMFmsn+C1kfqF2SejruXAK+OyhTd4G sPAA0Z97iqVcYlobjQWEjavvHpzzyVII17JPt4Q0tdclGcX/IC44n5u+ZdbfmENagJFJ UIceqQLUiSSOWykEW9K5bjxLPAupIG0t51sNQKYfak2j8Rc/bciuF73AzBrNawB/ASD+ aegw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697991598; x=1698596398; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ot75iBZaZUeJ5MEWunC8jIOcs8JwsIEUJRHg5ojxiKo=; b=bfGmlENfMGBVnOnJpoNoinb34Ua4U093cgV7jj6bmZM01zRbl/xjoJXc5N/8daII4H fJPFy8MmCmW7NxDigPk7wBaBlVj95oRijJFB6z+VR1vgPWLEH3Z3iOrTfjEMofnkg/aY /Gz0LP0Q0w4RxFzD4G3y7RieAOznzfSTCLOVYy1OW5Ek+KT+YU9TL1OYbcbcYOccKxDS 7IBYb1XB2pbJrwdK+Y6Wxdz3d67fIeJK8xVHrlefg9PkR5WNtwGmr/pRq25i8Mbi+FYd X8wReQdU/oBq1tgIu/M9oOyLHsGf+uC8FKoL4SMfoReI3FhaGxDSR/kE4Vp9++V5h3RJ 1r5A== X-Gm-Message-State: AOJu0YzA53p1NRqppn0XA2uoy7yATpGtvv+mhfwNhZxIQo6D3+tFCGwS M70+pgstrlNeCgYuCl190Emq8N1+2SC1pJom X-Received: by 2002:a05:6870:5252:b0:1e9:8182:a29d with SMTP id o18-20020a056870525200b001e98182a29dmr8669730oai.41.1697991597843; Sun, 22 Oct 2023 09:19:57 -0700 (PDT) Received: from localhost ([2601:8c:502:14f0:d6de:9959:3c29:509b]) by smtp.gmail.com with ESMTPSA id 10-20020ac84e8a000000b0041520676966sm2119718qtp.47.2023.10.22.09.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 09:19:57 -0700 (PDT) Date: Sun, 22 Oct 2023 12:19:56 -0400 From: Oliver Crumrine <ozlinuxc@gmail.com> To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: davem@davemloft.n Subject: [PATCH net-next 00/17] Change cork to a pointer in sockets Message-ID: <cover.1697989543.git.ozlinuxc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 22 Oct 2023 09:20:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780473260987268783 X-GMAIL-MSGID: 1780473260987268783 |
Series |
Change cork to a pointer in sockets
|
|
Message
Oliver Crumrine
Oct. 22, 2023, 4:19 p.m. UTC
This patch changes the cork field of both the inet_sock and inet6_sk structs to a pointer, reducing their size. Oliver Crumrine (17): Make cork in inet_sock a pointer. Allocate and free cork in inet_create and inet_release in file net/ipv4/af_inet.c Change cork in ipv6_pinfo to a pointer. Allocate and free cork in inet6_sk. Change occurence of cork in inet_sock to pointer in include/net/ip.h Since cork in inet_sock and inet6_sk will be a pointer, they don't need to be referenced in this function in include/net/ipv6.h Change occurences of cork in inet_sock to pointer in file net/ipv4/af_inet.c Change occurence of cork to pointer in file net/ipv4/datagram.c Change instances of cork in net/ipv4/inet_connection_sock.c to pointer. Change instances of cork to pointer in net/ipv4/ip_output.c Update occurences of cork to pointer in net/ipv4/syncookies.c Change occurences of cork to pointer in net/ipv4/tcp_output.c Change instances of cork to a pointer in file net/ipv4/udp.c Update usages of cork in net/ipv6/ip6_output.c to pointer. Modify occurences of cork in net/ipv6/raw.c to use a pointer Change usages of cork to pointer in net/ipv6/udp.c Change instance of cork to pointer in net/ipv4/tcp_ipv4.c include/linux/ipv6.h | 2 +- include/net/inet_sock.h | 2 +- include/net/ip.h | 2 +- include/net/ipv6.h | 4 ++-- net/ipv4/af_inet.c | 6 ++++-- net/ipv4/datagram.c | 2 +- net/ipv4/inet_connection_sock.c | 6 +++--- net/ipv4/ip_output.c | 6 +++--- net/ipv4/syncookies.c | 2 +- net/ipv4/tcp_ipv4.c | 2 +- net/ipv4/tcp_output.c | 2 +- net/ipv4/udp.c | 8 ++++---- net/ipv6/af_inet6.c | 5 +++++ net/ipv6/ip6_output.c | 10 +++++----- net/ipv6/raw.c | 4 ++-- net/ipv6/udp.c | 4 ++-- 16 files changed, 37 insertions(+), 30 deletions(-)
Comments
On Sun, 2023-10-22 at 12:19 -0400, Oliver Crumrine wrote: > This patch changes the cork field of both the inet_sock and inet6_sk > structs to a pointer, reducing their size. > > Oliver Crumrine (17): > Make cork in inet_sock a pointer. > Allocate and free cork in inet_create and inet_release in file > net/ipv4/af_inet.c > Change cork in ipv6_pinfo to a pointer. > Allocate and free cork in inet6_sk. > Change occurence of cork in inet_sock to pointer in include/net/ip.h > Since cork in inet_sock and inet6_sk will be a pointer, they don't > need to be referenced in this function in include/net/ipv6.h > Change occurences of cork in inet_sock to pointer in file > net/ipv4/af_inet.c > Change occurence of cork to pointer in file net/ipv4/datagram.c > Change instances of cork in net/ipv4/inet_connection_sock.c to > pointer. > Change instances of cork to pointer in net/ipv4/ip_output.c > Update occurences of cork to pointer in net/ipv4/syncookies.c > Change occurences of cork to pointer in net/ipv4/tcp_output.c > Change instances of cork to a pointer in file net/ipv4/udp.c > Update usages of cork in net/ipv6/ip6_output.c to pointer. > Modify occurences of cork in net/ipv6/raw.c to use a pointer > Change usages of cork to pointer in net/ipv6/udp.c > Change instance of cork to pointer in net/ipv4/tcp_ipv4.c > > include/linux/ipv6.h | 2 +- > include/net/inet_sock.h | 2 +- > include/net/ip.h | 2 +- > include/net/ipv6.h | 4 ++-- > net/ipv4/af_inet.c | 6 ++++-- > net/ipv4/datagram.c | 2 +- > net/ipv4/inet_connection_sock.c | 6 +++--- > net/ipv4/ip_output.c | 6 +++--- > net/ipv4/syncookies.c | 2 +- > net/ipv4/tcp_ipv4.c | 2 +- > net/ipv4/tcp_output.c | 2 +- > net/ipv4/udp.c | 8 ++++---- > net/ipv6/af_inet6.c | 5 +++++ > net/ipv6/ip6_output.c | 10 +++++----- > net/ipv6/raw.c | 4 ++-- > net/ipv6/udp.c | 4 ++-- > 16 files changed, 37 insertions(+), 30 deletions(-) Could you please explain the rationale behind such changes? As the cork struct is still allocated for each inet/inet6 socket, the total memory used by the the now smaller socket struct and the cork struct will be greater then the memory used originally by such socket. And the double allocation/free will be slower then the original one. This also adds a bunch of additional pointer de-reference in the xmit path. Finally the above change will probably conflict with the goodies introduced by: https://lore.kernel.org/netdev/20231017014716.3944813-1-lixiaoyan@google.com/ I'm sorry, but this looks really a no-go. Before future submissions, please read thoroughly the process documentation, including the netdev specific bits in maintainer- netdev.rst: there a bit of issues with the process here (the recipients list does not include a lot of relevant ones, there are typos there, the patch series is too long, it breaks the builds ...) Cheers, Paolo