Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp465970lqm; Wed, 1 May 2024 06:22:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2kKajyMLaRtV11T6IkBQ809Nm0OpVtOcjVFXPqg7lIs5SOA6az1a5zjM2iQjiu3USsCtDUjJlniKEG+EXH0byh+HiVlZ1a47iGlIcOg== X-Google-Smtp-Source: AGHT+IH82RiexVPHV0up2A2H5ATVkfQG/uFQ2P+GDQDdohk8YOGyHmn0cLyr5OlorpSH4FC9MF6v X-Received: by 2002:a05:622a:654:b0:43a:e53:4060 with SMTP id a20-20020a05622a065400b0043a0e534060mr2527382qtb.19.1714569750712; Wed, 01 May 2024 06:22:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714569750; cv=pass; d=google.com; s=arc-20160816; b=LZugqq/8dOf/+mEFr9KyKHDAjAwCp4VyG6lGyFK8UgjbhaIvOeABfd0bcN5WedE8pn 8z/VkEZ5f18GKHdlnqttqcVxHV+C4a0a8FF8GtBZMqJ84GVI/miULSTASS3v9Cn7d/mk jeCibJxO5DnNGoVkJRF3DBOaa5y0DRBGuuFkjhU14DeXS2jUASt1X1vEOr6zdDa1GjFb KnNmpXNlgyrJ/jMJ/vpNevkh4sgZ0211pqANVfCvy2fAr2suzzOLYG1wXzia9B/PHhmQ wFavWjc4Z2o9tMPoJn4lOKUaZttEZ2rkU5DseynhLA+oR2WZC8zwTTyAbNEiAZPHv+Ee SS/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-disposition:in-reply-to :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=UpYAPZv1iQb2/3imf+oIV+05NpmhGwXlIJWPudSMqM8=; fh=Pi5nHXkuD3Aq+FdKF6MeMQdtUS8xN9k5148wNBge2xs=; b=Rvya9niU95dp5Q10Vdjl8aY6Lj4Y6TulrL3Flx0PCTWZjK77N9CDtXKiDIy4w4GBOn S59b4Rg7Q00SNCcgrhveHfNVDd1mEW8+Vlq14qQU8Rxbf3ug+IscUtG0WGUacEImO/HG ZuyadnVC5bw/+XlqUl9aGbLkkjzUcgweVxhOmJSkCylKjk6n5Rqa8l5PmvwaLdNUcN9C TwReAwha20V9GcWtBva2fFVT80+L+CbVH1pIx8ITmPGZXeiKoW1nwLnfid2JfP32uD3I OVmuJAj1tutORTK3GTGapPggQfyH0oJdYR7Ebw5qb/T3mdoXtRbAqjVBD/jms8/MOjvO SrQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3119-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f8-20020ac859c8000000b0043aecf949c9si6980713qtf.199.2024.05.01.06.22.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 06:22:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3119-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3119-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6371F1C217C0 for ; Wed, 1 May 2024 13:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAA0A12E1E0; Wed, 1 May 2024 13:22:22 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40AAA12DDBF for ; Wed, 1 May 2024 13:22:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.211.30.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714569742; cv=none; b=jRglBZo11cG56x9VLMY0ycRew3vh047ZIz37sEPU3ygVXm03Daep0RHKmucP/olINiSjjH5E0BCFsK5lvJfocnM7Z6UHX02hbfY68oHB3D2d5b2YjvrBGjuV2ewnVbREgKxW0oTO1VsirVxnMHfyuhIoTlwxscoq4Nxk0zmrPjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714569742; c=relaxed/simple; bh=O7JO15oFlg0r8J5T1b4P/Wv3XRMRsBPXIWx+J1QfkW4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: In-Reply-To:Content-Type:Content-Disposition; b=Ilwa58a9zgA1nGCid27/D7nA89eziTZynl30oOMM2ZaacQ8uTk7EZ89vVXz2W/wckhpIlFChrhtNnfBwAMSdv0WPRaDT9ht53LjxMejRPo/iVkEkAYQw9uVn9Az13dTtKNjXVl4xGnIykz2ukLkLiq5pZaG09T0ddRg6xW5zPv4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net; spf=none smtp.mailfrom=queasysnail.net; arc=none smtp.client-ip=207.211.30.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=queasysnail.net Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-juZYqNPBOfmJiuipiVGNpQ-1; Wed, 01 May 2024 09:22:17 -0400 X-MC-Unique: juZYqNPBOfmJiuipiVGNpQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9CCA8810431; Wed, 1 May 2024 13:22:16 +0000 (UTC) Received: from hog (unknown [10.39.193.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52B561121312; Wed, 1 May 2024 13:22:08 +0000 (UTC) Date: Wed, 1 May 2024 15:22:08 +0200 From: Sabrina Dubroca To: j.granados@samsung.com Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexander Aring , Stefan Schmidt , Miquel Raynal , David Ahern , Steffen Klassert , Herbert Xu , Matthieu Baerts , Mat Martineau , Geliang Tang , Remi Denis-Courmont , Allison Henderson , David Howells , Marc Dionne , Marcelo Ricardo Leitner , Xin Long , Wenjia Zhang , Jan Karcher , "D. Wythe" , Tony Lu , Wen Gu , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Jon Maloy , Ying Xue , Martin Schiller , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Roopa Prabhu , Nikolay Aleksandrov , Simon Horman , Julian Anastasov , Joerg Reuter , Luis Chamberlain , Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dccp@vger.kernel.org, linux-wpan@vger.kernel.org, mptcp@lists.linux.dev, linux-hams@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-afs@lists.infradead.org, linux-sctp@vger.kernel.org, linux-s390@vger.kernel.org, linux-nfs@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-x25@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux.dev, lvs-devel@vger.kernel.org Subject: Re: [PATCH net-next v6 0/8] sysctl: Remove sentinel elements from networking Message-ID: References: <20240501-jag-sysctl_remset_net-v6-0-370b702b6b4a@samsung.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240501-jag-sysctl_remset_net-v6-0-370b702b6b4a@samsung.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: queasysnail.net Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 2024-05-01, 11:29:24 +0200, Joel Granados via B4 Relay wrote: > From: Joel Granados >=20 > What? > These commits remove the sentinel element (last empty element) from the > sysctl arrays of all the files under the "net/" directory that register > a sysctl array. The merging of the preparation patches [4] to mainline > allows us to just remove sentinel elements without changing behavior. > This is safe because the sysctl registration code (register_sysctl() and > friends) use the array size in addition to checking for a sentinel [1]. >=20 > Why? > By removing the sysctl sentinel elements we avoid kernel bloat as > ctl_table arrays get moved out of kernel/sysctl.c into their own > respective subsystems. This move was started long ago to avoid merge > conflicts; the sentinel removal bit came after Mathew Wilcox suggested > it to avoid bloating the kernel by one element as arrays moved out. This > patchset will reduce the overall build time size of the kernel and run > time memory bloat by about ~64 bytes per declared ctl_table array (more > info here [5]). >=20 > When are we done? > There are 4 patchest (25 commits [2]) that are still outstanding to > completely remove the sentinels: files under "net/" (this patchset), > files under "kernel/" dir, misc dirs (files under mm/ security/ and > others) and the final set that removes the unneeded check for ->procname > =3D=3D NULL. >=20 > Testing: > * Ran sysctl selftests (./tools/testing/selftests/sysctl/sysctl.sh) > * Ran this through 0-day with no errors or warnings >=20 > Savings in vmlinux: > A total of 64 bytes per sentinel is saved after removal; I measured in > x86_64 to give an idea of the aggregated savings. The actual savings > will depend on individual kernel configuration. > * bloat-o-meter > - The "yesall" config saves 3976 bytes (bloat-o-meter output [6]) > - A reduced config [3] saves 1263 bytes (bloat-o-meter output [7]= ) >=20 > Savings in allocated memory: > None in this set but will occur when the superfluous allocations are > removed from proc_sysctl.c. I include it here for context. The > estimated savings during boot for config [3] are 6272 bytes. See [8] > for how to measure it. >=20 > Comments/feedback greatly appreciated >=20 > Changes in v6: > - Rebased onto net-next/main. > - Besides re-running my cocci scripts, I ran a new find script [9]. > Found 0 hits in net/ > - Moved "i" variable declaraction out of for() in sysctl_core_net_init > - Removed forgotten sentinel in mpls_table > - Removed CONFIG_AX25_DAMA_SLAVE guard from net/ax25/ax25_ds_timer.c. It > is not needed because that file is compiled only when > CONFIG_AX25_DAMA_SLAVE is set. > - When traversing smc_table, stop on ARRAY_SIZE instead of ARRAY_SIZE-1. > - Link to v5: https://lore.kernel.org/r/20240426-jag-sysctl_remset_net-v5= -0-e3b12f6111a6@samsung.com I pointed out a few tiny details in the ax25 patch but either way, the series looks good to me. Thanks! Series: Reviewed-by: Sabrina Dubroca Note that you could have kept the ack/reviewed-by on patch 4 since it was not modified. Jeff and Chuck, your reviews got lost in the repost. --=20 Sabrina