From patchwork Tue Jun 4 06:29:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FE28C27C52 for ; Tue, 4 Jun 2024 06:30:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 392446B0089; Tue, 4 Jun 2024 02:30:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27C846B0096; Tue, 4 Jun 2024 02:30:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D04106B0093; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 827776B008A for ; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EE89312060F for ; Tue, 4 Jun 2024 06:30:02 +0000 (UTC) X-FDA: 82192231044.05.226559C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id E13BDC001C for ; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Janm6h/L"; spf=pass (imf28.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482601; a=rsa-sha256; cv=none; b=nRArHHDqJEISNWKNfaA2vcLP6DZsCm2g7JSs2UtXzM7deIo6v+EX7p6TdWRyboQB5seoEc wl+XijMBJ41VouhXSfj8Dc7S8TwpnHHy9Qqq4D48ogaimyHQ0WOfIHhSsqet155t4nSq9K Mp+9h5tID1aTo+xTsjeUynDaKSlSbdI= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Janm6h/L"; spf=pass (imf28.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482601; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+e7IW1FZgNMJoikAe9UUFiLH+nyx93bmeEBnO5G1xjQ=; b=Zz3zza3Verp6qslBKZM1YXqRtYTBRh7RhiZQ1J/EItOfxyKfeivMet9oHGwBF2soHJfIsK aqVLb0jZ1MhhMRGeuTW8BO1yW11DYlYSnBFHwx28JPXlwmvoAe/bf13cgaa3ywWWNUKHco 6syuBZAl8C8/GINUFRB32VsFUjO6DiU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 02D5B61199; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 9D302C4AF07; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482599; bh=vlte7/jFt4SHMLHwVPqBFv0PbVs5A4Gx+169UcJVYx4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Janm6h/LdugNk9//EITCAQZDYPDw1vSnkgIxHRJuajbB1uhJNb70fHHifyUdgIwcd Mg/HAMdxAw36cEdgsIlgBSdWy4Hc1od48ze7wM/QiaaAiTJzgstk8udBt6Zdg8/iOG f8VuGNUzWuQKpYFFGRqCGi2qBuVHvmp/E7SYChkdTKQTlffnCQs8/lsca4Kg0BegZL IM1CNUrig4EYtykD2DZQb1tjvma1ZoZXSYPE3wH1aCO3p6Z2ja0uG2BkYSqWU3Y4yB 6bsIl/ubhru7xQrDX8TdX9KSM4vlh1VmOObgZh71649aGA8FYEifSv59esu8EEoPN4 xSTPH1D/d4gTQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8419BC27C52; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:19 +0200 Subject: [PATCH 1/8] locking: Remove superfluous sentinel element from kern_lockdep_table MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-1-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=860; i=j.granados@samsung.com; h=from:subject:message-id; bh=14739GNIvIP1jcOFEalMBBReb5ieHSFF2clMwb/AQoM=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGJabxTBGOF4nHQDP1wm5ErY55X5yT1ko moGhHsQTVtxBIkBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRiAAoJELqXzVK3 lkFPreYMAIXr/sxZeeYa1hpzMSQR+LDo1okDOTVaAB6RI94p35Ph0NodstJFVE8/a/F7z8yznfT zRGB5mwTfERvnAHoLRa4cRPV7deYGX2Lfl4gRBxx38VVMXVNXGHuX412vQ/HGw8IG9A/McpDk0u Z2K9H7mdffgtNOrik+M5doL2wo8aIl3n/ntCbrFS6KMi5BjMA6JTGcCKPQc09MMFN8iWCyUlpHv PO0MOmlqI+ydfIGKM3grwe0ygIghPE7rXbC+RmQ/CFoPVTtuysPBixbT389HdPi2kwZfc3yMdiG JqIDpGDgEfx6eBoHqPi9f6UjsZsRZ8uQjA3cPhNf2r57I/Ous7iFkFzWnm9lsT7juRvP2yBLdve Fsb5u3LI21rJQdi9hKHm+Qy0a7lF7daS5ISDeA9YiPhRmI4qFElN50yOxuLkzeWdOmUek/m7eVe mIrjNatEmaWnNaLmtaw3exq+Eoi54Rdh5QCBMA0GRO+dVR2JtZ85j6nhTdGkijeKFOoJQ/Vz+O5 Xc= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E13BDC001C X-Stat-Signature: 1wkj9x8b14hf8sezfwx49f6ywqr3hgo9 X-HE-Tag: 1717482600-119738 X-HE-Meta: U2FsdGVkX19EOX/DN/EcCc4bAraUKoXVb0pBbWWXRx18vbWPWWwUZFfYfp/tfQK8GSB+0b4AnKsn5P8gB7ANfV1UGbX9aFX9ED7pgHncmWsRKxis8baqEvNPoVBW7Zwg4ZrEaPrbhHAgchI1JVHmzgCHbMxYMZ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u/qzoMRerylsl4CPm+XUKUHJefoH5KjfMRd3ULVnwbrwysHb4SZcFprJFj9rGaPkZqHxaTb9+dExAFwosa4++lpShLfZmUPGRorXsO7y6Z0+HQSTjqXDl/TkgQD5xhTgMA0Rbm6/XfHz6bS8oGu6nkirlpIwXWcIGv973/YU6zPdqyyTi3e3NmjugYaGstLjNR0X4plEcAk4Lh90fQbI4o/i34fnwyUzTcmhQ0b1nJdt0/Mg2QCAzN+0VJnvW7KNWqZOyg3ypkx//E1Xa6XlhjPV1PrrbmzcwMgFcLEP X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados This commit is part of a greater effort to remove all empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Signed-off-by: Joel Granados --- kernel/locking/lockdep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 151bd3de5936..726b22ce7d0b 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -97,7 +97,6 @@ static struct ctl_table kern_lockdep_table[] = { .proc_handler = proc_dointvec, }, #endif /* CONFIG_LOCK_STAT */ - { } }; static __init int kernel_lockdep_sysctls_init(void) From patchwork Tue Jun 4 06:29:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 599C1C27C53 for ; Tue, 4 Jun 2024 06:30:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F28836B0088; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F03116B008A; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B57916B008C; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 837036B008C for ; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 05E94C0D9C for ; Tue, 4 Jun 2024 06:30:03 +0000 (UTC) X-FDA: 82192231086.04.2865295 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 14AC020009 for ; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XmOaJBCN; spf=pass (imf13.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482601; a=rsa-sha256; cv=none; b=MegvGD2gFipqBnxKkyxD8i5cqUfb3dmZWrfqSsobo1Fh1lVx9uP4P3wTnyvC3EO2FnPwhk HJMcf3RXlnIvVQ3VrmCFZWpUWVOk6YRUoxqjZSxEpTes8CKQGWHnRxTCByTnJSpQF9/pvZ 5DhY+zO3cbOEj5U5q3uoaeXFlru7W28= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XmOaJBCN; spf=pass (imf13.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482601; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+1RckZw3CGfs7GvOUUFzSHlqQ4mrjdbz4Vl0igwxUEo=; b=fDbKxA8TW9M3AAv8R7pr0QARN0uOc4GR+a96Nlz+A1Zyk/8ghCP6zYFDqMNP/fSi/wWqJ4 Et7Nkgw4N89Tm3QDCs278YdL6NiVWczmLAPwXH8QUQpdE+MhOdkouAzWGsaFb66TBOpYQ2 IapNDDNc78AKclmOrTocwn0C+IgSKqA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 51E9D611FE; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id A60A5C4AF08; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482599; bh=WuskAK9QMw2Rb7LOBaE2ncAcIhSptttUqQRlOQ8Mdw8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=XmOaJBCNNhIk3UU18TsE4jmyx7Lq7jCrOLUmJNxjqPDcCFDgQl2DmJgWeBoO5O2cy hbtVw89hITlfEkLbn7HfQHjHjdjQZjHcowoB5tpg7avtohdheMiJ17HGEWrP0NXZei QltPuZBue7VdCJkD9utcSgbTjV0DFdShfUCtR075TP9XMLt5aJ7lP6hAPskiJeheoH 6c68TGQVytiKrJkdqreOoQGp0MOMHBx47+s6j+SBYvRz4QBvPWtVhDrSfGAGlSHBn9 jNtKztz+66GA9ocoVqZV/4PWQhpUzXoz3Y989QMQ/jChKBqmFU0IVRf2ioegPhQyHV /Tu0jucWCC6UA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 935DDC27C54; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:20 +0200 Subject: [PATCH 2/8] mm profiling: Remove superfluous sentinel element from ctl_table MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-2-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=862; i=j.granados@samsung.com; h=from:subject:message-id; bh=grXyma2z6K/wRopvypgEfIMP+PFHWBDb7VqNp82ood4=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGLtay8GHHZfoulwDT7Cp/+NFmjaUVFeN K1kk9wfksxNuIkBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRiAAoJELqXzVK3 lkFPLVQL/RZBp0EyIV+vm0gXQg6+z7wQ3w++rqI1ydJNjnUfIkWxiBXMoWjegWKgorptI5L0LL5 QiBGzg09KK78sYzgGlTjTudseX5pEj0wPgl5NA41VUKS3+eKByodee1SAT7w/5KgDAtjOwJiCmx hsXoF/SogQ0PJnNF+lZgwNnSukeE3eotjMuL0fhv7BGE9TwpcF7pOGrqB8AmLn91nFXyVOWjtBj Y/BhWU1/R5n57AbIDkaR04pcY907qAipnMbKVrminTdDhcjrYBuoX2O3K/WsV5UGPLWxg7Pwr2+ DKSCcd3f7cgKGvrqvuO0E1bsr+dsJj2zRAGJsSJtpfUhQ5A/KnmBUxbFb6W6IGbQVIfeAia9jys u3mALmKeyGRvnUkSMmH+z8yrhDmtI4Hn4lQUh9MofiwVN8fBR64dUuoxfVJhH2vHrg9PEnToAUN 6djR12wRe1b3eoxy8lGrrPi6EMi8z7R+qmxIqSo83Up6qfK7p2AMUDkiSJY6aoyusP77KXPACI5 0I= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 14AC020009 X-Stat-Signature: cnchddx1if39bpii54jogoeop78ax7wm X-HE-Tag: 1717482600-507638 X-HE-Meta: U2FsdGVkX1/hqiDxzrZV2YPhRn72pP9ibYz8lVjqtEVCqqWB4+wkhkh5yQFc6Ol4ct3rKpvhL8fEgF1cgkoBdNTUdO/krhD2pb58x2HWuycSN53MTHfNFS61iRr34Kj3/DkOcyx/u59VaGiu7LQ1uzP6gKAp2+ouqWE4YPEg0zcMM405bbVFQye2CfmLb51EzROQ1O6spJNyw3AiGzZUPb4ahMGXk5qQyt3cEU5VmtJ+aDNZhHed91ZzGcU8ycAGbYWBpfilZCVwcmlB454YJtNbFSAwQjyBJSKeyR1brTWw8MbiS74yNv3IGYLhcjI/sGpi2z65esoKGwRPimx+QlFMKdYv5P2OP3mvB3eJ9rYfclAOGRwmjYUAIAFkuYYJj/cabA115tmjPuUBBLZAj+v/E51byN501cpUUK1DRXTi37e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ABGAxWB+x+oljwdZEwziXzuhFBmIRYP+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados This commit is part of a greater effort to remove all empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Removed sentinel from memory_allocation_profiling_sysctls Signed-off-by: Joel Granados --- lib/alloc_tag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 11ed973ac359..7293cd54d1b1 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -238,7 +238,6 @@ static struct ctl_table memory_allocation_profiling_sysctls[] = { #endif .proc_handler = proc_do_static_key, }, - { } }; static int __init alloc_tag_init(void) From patchwork Tue Jun 4 06:29:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8C4EC25B7E for ; Tue, 4 Jun 2024 06:30:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5A3DB6B008A; Tue, 4 Jun 2024 02:30:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 51B706B0093; Tue, 4 Jun 2024 02:30:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA24E6B0092; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8F2CF6B0088 for ; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 48FA51A0969 for ; Tue, 4 Jun 2024 06:30:03 +0000 (UTC) X-FDA: 82192231086.04.A6F2B5D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 56A62C0008 for ; Tue, 4 Jun 2024 06:30:01 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pA4dmeog; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482601; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IJzMVukPtS876YYkYzr1cLufRLNFzlqZjVB2lI5Csko=; b=Vn1c6ECAe3ZUz7kQU9/OibwXWMVcUGrvZySwuZ9bt0WxyUpQEuxFzAVYWMboLmzfe0Rw1z 6rNcNIXcf3HdyiaiQcTiIL6OBhT52bExNxWnW5+bVVYdpsqGW4jXC3FlNjHGvgMPzttU/y y4WPYQKSunteFz5AIysfOvheRzajSp8= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pA4dmeog; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482601; a=rsa-sha256; cv=none; b=YNY5PUUIdn5iNB+KEqIu+QHJ7p+NCtxcLfmRyMMAvt+z/g5hvBo08HJWKx12o9YJwSSyCw F16NwgI5OAW706zGVMvy2wxHBoWtEgjvsf6CDvVo6KACQujlpTH9Uasv8qtQdmASwC6Xx5 K1Xss6um8iUaX3r2rzNi1OUJVRO7oUc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8F78B61217; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id AEBC7C4AF09; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482599; bh=SiVUhtxONKQWX+BBZwI127KwpXG2Q3vZOfxEJQppcWk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pA4dmeogTARSZfUZ/Gh9KHrzmf7wDP8GqwUGhu5YY1UfYSpIYx7Ne3usxtGqOwF2J mA5x5+xvD0pZwhihYG1Ufi1aaFA8o2vmdw121w6VUTnpX7cM1CcG8/w9hdles60tLI 5sNqVzC6xqZol58Rt0b4wJcCTQLTqh5WaMaM1gJt8R8rFyUCTLy2e78mU5MjXxt9xv 3+j9/MOmODLqmTStj6lUdjNt3QeZfewviDek6mipvnJGN1KTs8WIU/WH4EyjcrQx5i x+Sbm2GdzftBbBsodZq+OgHOAWOsgB5lDdMspCkESqr7WUTz24atJeZbtBMslDcz/A Xah1DKevIQW2w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0F52C27C55; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:21 +0200 Subject: [PATCH 3/8] sysctl: Remove check for sentinel element in ctl_table arrays MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-3-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2348; i=j.granados@samsung.com; h=from:subject:message-id; bh=mD4Ze/7MDPElpYuv5XGK8tVRov3P49zLBw+A3YRwezE=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGMc5UA19wZYyokNq00ONpu/iFrRM3b3d ji21KMQyCufh4kBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRjAAoJELqXzVK3 lkFPjSkL/jbkTtKEHy2F4Zoay4bUyht8qYvmVrqYV35vhM08LmptpbTf9aDW49d1wvwom8i7zTo +bkTEJ+q5fEM8JibuQ4wBCwuyN55TQaiyynC6+P1sISJFiR+wNNKUkzoJZJuds9xIN3VHDBujmF hNT6GLin8xncVd6bXgjH1ukPvQamXDCmxcTzZ2ES5fPV4d063gEAAo0nfHkZRnPYcBfiPAf6E0W 6G/lTK5uCzNa1ienyagjyYa/UhAA/5IR33bkyguc9SGsBIZ5T33xBdFUHEfNS3GwclPA2Yt2jZ1 LYUI6YkfSftzj365NjA/UIsfGOdho/i4+CyV68VYXCQ0uQqSokz3ckRi9m/9JJOmT+qgzaSJbad kdWkSUcfn0vkojZPlpE8X3ed9U671GRAu0H/6f3Mv1yLfMoZEfspW68GFf+XV2mwWYYfmJl8rny mq0grO/Kf0H96o3+fcySffKJnyun8yE/Sil4YyRoh2AS4mwi23lOtffZxZJuyJcUTavw5iP4Pw6 PI= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 56A62C0008 X-Stat-Signature: 3ouwxu59wuktzwnyibus9pyc5x8inaj5 X-HE-Tag: 1717482601-900890 X-HE-Meta: U2FsdGVkX18jWv+9FYLc20Nhq3LkY6Zaxq49/Bwoj5+bSz4iNyxWeCJhj34OWNpHbzY+VYCsFOYgedyNX4RX2P3JAsvsRBqS8PDuY4zdBf0dFfrvIhiQdlvU4nczYmz108fcp+7NyXgZq0X5Btk25gpK3kkpppkrwAwU6YBW0qOcSMmRW4tCbrK8/kOXOAUKwHg+FyioHgTSncNO8gA+a8ZpaqCPdTmIj4QTtv8jKE9cMt8KFB3tZB8vcPKXFR3JRqKKdGvBKkRLGmAzm0f6Ie9Qlhbep9N0kP7Ng4YSes5nVw64j0heyE+phfuMHT4D4eA9qfF0Hnk2uDjuzL2WXOvUTOB+8pN/K0dGISNSlH1W1K+bDq/Cy0DI0/YY4jCnXZkmyA0Fb2MPHf87OFkZzksRsM5q3RFM5A8jSSWJZjX3vQ8DAQDLfOFr/HMWdM4v21v9vkO61o4Gw6+4rAFeH09ftLaLQXR5AjaTDuNYibkOXe4F8oRTyKljo/2U8xrY4y9DKtzNrtUs3FAdUyQxsBEEjkNZB2J05t/yGPjdp1Xn5GJT2aQyOseZYoBADBZIqAbjqTxDbHLC0CdF2pXXRdZU4gOPtuBDCvPvsZTGvUyJ7TLSk34Rn/eQesPv+8sE2sLkNsqb9LxcMX+qA82XbRKp+LA+yArDKavRdEtCNiAH1GyJATjT5BxsUYJ98+mAmEthn1dGVJRvIIeWSRvdpkA8CwFGxz7XUyXnZ+R6Sg8DTBKgP4xyfTWTJBd/P9/DiBz9Lc+KmZTQjCCfhbuR5VZ1fSG/Nq82r061ZkMTeYFHvrOCqLQDTMpjD/g8kiN3FpuaOL4H+l/fDA1IfJZGGUG1+iCEBs4PfyYgYTzrS4SSIDCSZB29IJAkyZWYJ5wN66L7He4STSD7u7ZxvRlH6r37716Viix11Va0sqouChMnhG2Petfni7CwtofaBoj82wecC6HDhqzj5sd9r7X WG4fp0U/ zmgnEfQ0x2dZUAGl88plbwi1XGO5IqfcTVhnfz0aNcTrTZn5gmjKDUl+m1/SHpRFY+/MUXQttrqXBIzpT0owhmCfiRSB7xfhi7Hq6NvO4QIx8X38XiO2K7ziDtnxUaL+er1nvMhC+m6RKFrxWa0/QMu5oGT7FM4FwUA5H26BZhCLv7RLmz1p7t+u31RGccu6J+0ukn6ZTRivr03np1h9IsLcrYahXVWJSpveykjLvrP+oPXzgcaeKdMddnkp+yEWZnP1nKDnjWe1auiF4eJ1u9kBAvXIiPW3CFaS3ooGhkPHzlYi/Qyao7y+Mikd54c8VTcTsODmBrA/1RaScumg5iyHcM1mhgpK0L5nzmP9tInJDjDg4zP5WGiPhg4L6jXq9ZLUt/ME05ww74wXWSq/8BBXnu58wXVGgSuDDpVwtAWl+fhZ11SJf7Zama+xqvuswYs6q69PLn8P274yh5+83sbay2ryqm246ZM4nu/P5yUED09+xXb0SuShj+o9IQQj5LcWDF5FyndLR+tmRWyTH+XscxEcznNkYDogM X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados Use ARRAY_SIZE exclusively by removing the check to ->procname in the stopping criteria of the loops traversing ctl_table arrays. This commit finalizes the removal of the sentinel elements at the end of ctl_table arrays which reduces the build time size and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove the entry->procname evaluation from the for loop stopping criteria in sysctl and sysctl_net. Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 2 +- net/sysctl_net.c | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index b1c2c0b82116..d4ba7ad9dbe0 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -21,7 +21,7 @@ #define list_for_each_table_entry(entry, header) \ entry = header->ctl_table; \ - for (size_t i = 0 ; i < header->ctl_table_size && entry->procname; ++i, entry++) + for (size_t i = 0 ; i < header->ctl_table_size; ++i, entry++) static const struct dentry_operations proc_sys_dentry_operations; static const struct file_operations proc_sys_file_operations; diff --git a/net/sysctl_net.c b/net/sysctl_net.c index f5017012a049..19e8048241ba 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c @@ -127,7 +127,7 @@ static void ensure_safe_net_sysctl(struct net *net, const char *path, pr_debug("Registering net sysctl (net %p): %s\n", net, path); ent = table; - for (size_t i = 0; i < table_size && ent->procname; ent++, i++) { + for (size_t i = 0; i < table_size; ent++, i++) { unsigned long addr; const char *where; @@ -165,17 +165,10 @@ struct ctl_table_header *register_net_sysctl_sz(struct net *net, struct ctl_table *table, size_t table_size) { - int count; - struct ctl_table *entry; - if (!net_eq(net, &init_net)) ensure_safe_net_sysctl(net, path, table, table_size); - entry = table; - for (count = 0 ; count < table_size && entry->procname; entry++, count++) - ; - - return __register_sysctl_table(&net->sysctls, path, table, count); + return __register_sysctl_table(&net->sysctls, path, table, table_size); } EXPORT_SYMBOL_GPL(register_net_sysctl_sz); From patchwork Tue Jun 4 06:29:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684734 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D55AEC25B7E for ; Tue, 4 Jun 2024 06:30:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8256A6B008C; Tue, 4 Jun 2024 02:30:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78B8D6B0096; Tue, 4 Jun 2024 02:30:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 11CB06B008C; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A0CBE6B0089 for ; Tue, 4 Jun 2024 02:30:03 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 56D1D1209AB for ; Tue, 4 Jun 2024 06:30:03 +0000 (UTC) X-FDA: 82192231086.26.8C31A0C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf25.hostedemail.com (Postfix) with ESMTP id 469EEA0003 for ; Tue, 4 Jun 2024 06:30:01 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=q8sqn2UI; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf25.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482601; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Rf6JECsEhR/KpII9koEPNaCVA4v6Ur1VLy6ZgLK9guo=; b=aG8Lb4ETmET7Td0k/xBZDFVp5xjq26WGyl1by22g0TQgLzq+VTjx5XZcVp4Cp+OKvj659n edk3OCIf6bTRBorAmKshU/cdoO8ULkK5q3MrGLJtloUPa54axPpCm+PnULMgGxfV62a4yA WgWZDdgJyyqahzxUBUCEBRlVvvqkM9s= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=q8sqn2UI; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf25.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482601; a=rsa-sha256; cv=none; b=pMhjR5L4DiHAnKtJfhx/HPoUp1+IVW3XtSC4I1OB81XYZW9XVZzmWwgYj44OZiaLQ2rooj uu7pOzRBiFNW5jmOa+Dm62Jl1M9jYapGZ7qZmUfBgXBKrDlO9J+AvnxOyMnm1J5MGh6qMR KzMhgAzF/d5nuMeJ7uCFo+ipsV8rCvY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7654461211; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id BD22CC4AF0D; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482599; bh=qnk8lkgaR1ZcTBtK8DdwuXgNlEzaf3fm9+u2f6xPjbg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=q8sqn2UING2yH+C0lcGQSy4ae0FcbWJrC/vs7mpC04KFg1OQJRvbK9zk+t5Fw/rIR EXSXQVp55YTwcmYQApUkmuu2iBDhC8iLZ0bQAqn5D1BkK/WZr+UBT8CZVt6H8PxIjg ZYTMUuFRe2XlLeU+UTju9SRDmbbt8ASi+Flu/QfnUo+d9b/v1GYlHruDAVJbdprcat 3tCLPSjEQ5pBzKJkGdHOWkbi9N6PHM1x1F5tWDqDHF9zPuM7Dadi3X/TJlDHqc4csl t5+ByLcktT3kpOOhg2GCTRNVMD3F3FnIkWuDh54RMgQoxxdZf52k9L2Y2XUmYe+gc1 BdW6AX8HkNm8Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADAEEC25B7E; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:22 +0200 Subject: [PATCH 4/8] sysctl: Replace nr_entries with ctl_table_size in new_links MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-4-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2054; i=j.granados@samsung.com; h=from:subject:message-id; bh=qaxk3rDogN+ZQLc9uwmgCuRk4aqbCXJb1N+PNG5WkHU=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGPmD7WlkmXC06LM/3KIlA0dRX7bMC7EC Mz6CbqNQM1cIokBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRjAAoJELqXzVK3 lkFPAi8L/jtTQsXQjrugX/vUO+3ZfV6tbEgbfiD5VOWt6iknGkxcPfsh4zkeVU+8DtrCDQ0oTo0 GK2pL+u7ZNsuK18g4OX5tQMQVfAa2WTYIAakatrnYIpkAvyS/IRkkCpJAggBFnIPbUoauOXuhtL vVb5HV0xe3NZMqFfuzg3sgsCCwtnTZ9jKMfXD/KSW2MGFqGP+hgjtkXwyzoAvgnsgQOqsKCG6+x MvS/OHonmHCHQPsZIeZVrK1DRP4wZyzDTW2YybRazjY24n+c+5JZ5PPbI8ll/f29f2zjq7k3bRO ckeQIGnXL4rCPhIB82vSKkxAmUeD/pUQvw120K7thSuG4GGl0vhrTYxH5QkC783QZN3lH+lGPMO StmLrdQkPtEG7L0BcxN1FSMQGG2dXI3KUR2Noy5QDAu4bAwnQge1FBEVa/4NNgBhFN4NHyejdNR yFpQcnPYKczW4mfyKjeQDHvC7T9RuoIqhNR2eW/3Zmhz/KXrysvomOq3G2E40T12Zu/PH9FuYL5 l4= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 469EEA0003 X-Stat-Signature: yb8rn5kxzrh445g9drjchrrhfnrycgse X-HE-Tag: 1717482601-488522 X-HE-Meta: U2FsdGVkX1+02CBhMFdKmSHQWMZM8oCKB8SEik92P0J+XjQoh+40uPht9WzzsjkkDJPCcWpH9wv1QnZ3IDq2IcuGgTv4XKvpIwZjcePEt4etuBBhmdP4bzHmJZHVjqbCj+mWEYfMM65vAsqxVCRxqzbDxNNdy3m+HJ4n59A/4vlcM7zTaNXN3Amn++yO4h680YyrWM5otsbhO1hzH32tjvcw0KDtL5txUI7XH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nvO1C5N+RmOgV93ORrtI+NbIu1quNEdOBK73nlnpibHJkZk711WtILF4BevelAOdiBB/9niSJ5EbLaQzhO9Znn1/7oAG8XwHMDXXiVtDZw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados The number of ctl_table entries (nr_entries) calculation was previously based on the ctl_table_size and the sentinel element. Since the sentinels have been removed, we remove the calculation and just use the ctl_table_size from the ctl_table_header. Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index d4ba7ad9dbe0..1babb54347a4 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1154,18 +1154,16 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_ struct ctl_table_header *links; struct ctl_node *node; char *link_name; - int nr_entries, name_bytes; + int name_bytes; name_bytes = 0; - nr_entries = 0; list_for_each_table_entry(entry, head) { - nr_entries++; name_bytes += strlen(entry->procname) + 1; } links = kzalloc(sizeof(struct ctl_table_header) + - sizeof(struct ctl_node)*nr_entries + - sizeof(struct ctl_table)*(nr_entries + 1) + + sizeof(struct ctl_node)*head->ctl_table_size + + sizeof(struct ctl_table)*(head->ctl_table_size + 1) + name_bytes, GFP_KERNEL); @@ -1173,8 +1171,8 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_ return NULL; node = (struct ctl_node *)(links + 1); - link_table = (struct ctl_table *)(node + nr_entries); - link_name = (char *)&link_table[nr_entries + 1]; + link_table = (struct ctl_table *)(node + head->ctl_table_size); + link_name = (char *)&link_table[head->ctl_table_size + 1]; link = link_table; list_for_each_table_entry(entry, head) { @@ -1188,7 +1186,7 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_ } init_header(links, dir->header.root, dir->header.set, node, link_table, head->ctl_table_size); - links->nreg = nr_entries; + links->nreg = head->ctl_table_size; return links; } From patchwork Tue Jun 4 06:29:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684738 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D5AEC25B7E for ; Tue, 4 Jun 2024 06:30:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C469B6B0099; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BCC036B009A; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A03546B009B; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 820DC6B0099 for ; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 01BFE4095F for ; Tue, 4 Jun 2024 06:30:07 +0000 (UTC) X-FDA: 82192231296.06.E6588E2 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf14.hostedemail.com (Postfix) with ESMTP id 4562610000A for ; Tue, 4 Jun 2024 06:30:04 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cypzoF8H; spf=pass (imf14.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482606; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OCcw4Iwb7QwzY/s7rwXs+uaUycHgTYIKpDyBqKJN9KA=; b=7ZdUjOa7PmNDu4nBp7EvjXlqrSDsQGDs35P0Vgrnd93VftoHLBF4fXlVw1zzeBgH+dtBrC 7iStCXK3vTypMiOpZVa5cgNKceUWWRQM9qbxA9zz7HvhheqoEmhxiUSZhA0MdrxgnmzIAs V2k5VHgIcF0j56SII/qp+PdSqWHtD/E= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cypzoF8H; spf=pass (imf14.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482606; a=rsa-sha256; cv=none; b=uiDHYNBApZuCSWsSrm52qkIu1pUxLoO81MfgDU0nFinCd2TnOUvFpL51sZI3ZEGbPqqVdc koexLsq4qTHelj/dMXh5XyX4ASFpZhHX51poB3Q1FQPzLqSj6PS9V7N5EHABOVXmWcVheq tBeWb8f9MOT1aVwCVLK0ly3sfaj/OnM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 9645DCE1025; Tue, 4 Jun 2024 06:30:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id C6F46C4AF0E; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482599; bh=+9m/xQlKsI8pqumJbCIgfUOr4dYZwdwxkZ7BbsD0p9w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=cypzoF8HBNiKPC2nUW6/CDayI/9sb7tk1EtuIsF5LNkC/Vvb+lntmVYJEU2yPN3dA Ywxo0gc6flAZv29VpNp3LTsFajnFwGDogaqn6kUhNBrkFgUN3kNw2mvICiomWHaW1o N+5Gyr8ievMcOl/NAHnguvAJGOeRS/NOsViAWyNA+2fmH116RFJjF2A3licAft8U4L WcJb4OJewURJ4scZFVIoFS4fPM5kEwyLzJJLmbsLKAa3s1isHrTUfrwnxbG43DDnxT rsIt5LYSNnfJ5gvdtg0Bz7jZDaJltPCZITDdFXU3HuLeQl12etRnAYp0XrWrxis/B0 kvFEyjLzYCWdg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD3D1C27C53; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:23 +0200 Subject: [PATCH 5/8] sysctl: Remove superfluous empty allocations from sysctl internals MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-5-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1905; i=j.granados@samsung.com; h=from:subject:message-id; bh=dykX5g3MqGx15MATEKwwLa2ClmbIRatln9uC2eazckc=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGR3E2qjUjAS4q9w+HjZ+miKQrmluWXXn C0vkfATqOvX1okBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRkAAoJELqXzVK3 lkFPwCwL/jqnIEcEWutsOWB1UQTKFkNA7cz4uGlz1RuXDsLJxTehHd+yxHkXH/uC4QSeWlaJMhI y/M6hBaSMqyknpSMeXjgwML0myqcwanvUI52qQez7GuzEmaMStbuewJp4fIOopCHSV3fAefx++0 OYitv3k2B/txIQBpMqoHWgB9DejZcZzzB/KygVZrRs/vDrkWdIl5uMR3J/Ehw3MmcW+b2pU2os2 pXUQCyBxpa+rOAvWTm7MXOBOHZJnXlIKajR4RLbfGSvkNXJfLmHwY4XuCv2N9BXGX0RgCoMEYSM C5UiFki4U0ojWqyKLxg5Lj8T0XgxNjRvgtXo/ao/vdejeY7STem/sCXWVka8SWuXRY2YAFfBlcr mU7T+yqjI8JVf6MTCkQYPk9ueo5YHbqWt+oGCXPDUfFfELnkSsWHAsH0S782t4zi4XrmyP3bUZ9 KAkFDTj8PBaGvHxjxnIsU0ZxjNwxosVnynxuCAKNSU4szTgMzcl76Ck2/It8V8v3qnnHktCQJU7 uE= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4562610000A X-Stat-Signature: uq646py5me78d8484c1nmkzh7jqa8yrs X-Rspam-User: X-HE-Tag: 1717482604-191443 X-HE-Meta: U2FsdGVkX1/TVtkCwvHA6dfP0RfjtEuQSvBkK1grkmRps2dr9aiD1vMD/OQNAlya/6pgNksIPFLbJA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hBgFm//+U49SRxAQto9BFIjgA7X+7gRNOrWlL/F4ABhav+axBR2ycKZkRr/MwWR99MWPpgR2I5zvCp7zU5aFBhC9cSqZ9BYg+rznTg2GYFBk3d54KHh4HTFTVrmZR6nfhAzm/rRGIZfnEg15lcSZKVRGejxezhI21fSnPjGBMhoxkn9wbUSm4sEdj4HA+QM3VsJutsh5vqoh0dDmDKW3phk2/YEtxWH1iUsH+I0A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados Now that the sentinels have been removed from ctl_table arrays, there is no need to artificially append empty ctl_table elements at ctl_table registration. Remove superfluous empty allocation from new_dir and new_links. Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 1babb54347a4..29d40f0ff3ff 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -951,14 +951,14 @@ static struct ctl_dir *new_dir(struct ctl_table_set *set, char *new_name; new = kzalloc(sizeof(*new) + sizeof(struct ctl_node) + - sizeof(struct ctl_table)*2 + namelen + 1, + sizeof(struct ctl_table) + namelen + 1, GFP_KERNEL); if (!new) return NULL; node = (struct ctl_node *)(new + 1); table = (struct ctl_table *)(node + 1); - new_name = (char *)(table + 2); + new_name = (char *)(table + 1); memcpy(new_name, name, namelen); table[0].procname = new_name; table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; @@ -1163,7 +1163,7 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_ links = kzalloc(sizeof(struct ctl_table_header) + sizeof(struct ctl_node)*head->ctl_table_size + - sizeof(struct ctl_table)*(head->ctl_table_size + 1) + + sizeof(struct ctl_table)*head->ctl_table_size + name_bytes, GFP_KERNEL); @@ -1172,7 +1172,7 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_ node = (struct ctl_node *)(links + 1); link_table = (struct ctl_table *)(node + head->ctl_table_size); - link_name = (char *)&link_table[head->ctl_table_size + 1]; + link_name = (char *)(link_table + head->ctl_table_size); link = link_table; list_for_each_table_entry(entry, head) { From patchwork Tue Jun 4 06:29:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684737 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 307B4C25B7E for ; Tue, 4 Jun 2024 06:30:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C9ED6B0098; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 47A446B0099; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31A786B009A; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0A9AA6B0098 for ; Tue, 4 Jun 2024 02:30:08 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id CBEDD1A0978 for ; Tue, 4 Jun 2024 06:30:07 +0000 (UTC) X-FDA: 82192231254.23.F54EBB1 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf18.hostedemail.com (Postfix) with ESMTP id 3ADA41C0016 for ; Tue, 4 Jun 2024 06:30:04 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="RkdsXLX/"; spf=pass (imf18.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482605; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lNwBqg1RlHfDvgRNDJRYuz7PqZC1ddC3YzSMApMVVGo=; b=Q7ijKjDr144j+C1uichrbcStk4VFP+OJ9A7MNQHhwp/iyKnFzv8a3C4QIb+saD2m11M2AN PliVHTJqcY6J3oLNKoT4bmVTo45qpplAeOlaywt2XvG5gamgLrinZYNtuTUhLa2vG6ZBut Q1DQD9fS7KEgN5od5NSADMUEMe9ft3w= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482605; a=rsa-sha256; cv=none; b=BK6OpX/RElLH9JoiIdl2D5XeMPQyEsHUZSe3Qr+/7FkVtJ1FdsDrB62b42XiHb+OutZDwk 5AtYoGMVdsZFCkqbmpqrhmCrNH6UlHbQY0Is7yqWOKckIM+o5j+vWSGEEztNnDAeIE5xTp xOivfVQo/b3BmY9J5DzoswbguykmF+s= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="RkdsXLX/"; spf=pass (imf18.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 96446CE1021; Tue, 4 Jun 2024 06:30:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id D51BCC4AF12; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482599; bh=uQvKTedfeUJ5bmniBUr9CwYhnYEum8lzyXgoPJAiEIM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=RkdsXLX/rWNsSnP1w0vpeQO8ySbd33WZFy1o2u5e5N1MaiUcQP2TG2eJUTndxXt3q 6OxqXH4y8t+bk4SdJBB3SvyQOefglzILYK2uP527CPP9zD1yZnWraBkOBsm4sLCqvX /iqL5IFdy0HEEVY+3Hvot+cQfBKhwaGAZLW2Nbh42ex6j3bVFoM2Kgz7lYTG5Ge4cI NkKMcVXcV1cGMITbeti1Mx3rTuvfM1gBbZ8rdw4zC9O1kXyytocY5qr22xKPNCjSgi OLoI75IpKFkEerVQqpHzGSKIPc+6ljn5j5vYU/Lr5hciFXi8M3TBJ8M6gjr5QnTVYt UYTwzOiJ9VLAA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC4ADC27C52; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:24 +0200 Subject: [PATCH 6/8] sysctl: Remove "child" sysctl code comments MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-6-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2907; i=j.granados@samsung.com; h=from:subject:message-id; bh=0XKCBtKXUsaQ3icltpQ/GcT4z/xTnWSxXkUvgvEAqjc=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGSx+J2DsW2akHI1bXUBxwZLWJOp+r/vp Mjc/iI3BpjvEIkBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRkAAoJELqXzVK3 lkFP5qIL/1mam3EXhTaxS41hy26Dmq0UjeoUbnRZYhSzHmbvW3UT9tGd0CEzkRmrmeO5pdUckpq /Xdt4dyVI2zsF1mpS0/senLUoeACPSh46rmxp5ymGQQZ999WnsOewsF44Mjh/agSxFKYLIMWhTu HP0QK15UKiFYjQVS/IcARz0Rq96i8bWVETbMGfCvTSh9swmqxWj7VqNDY1mXl1MIHr+Mzh6tdB1 AHaTV/HasD29w/8TIBI7J+II662XOod/LWhfuSYUKtkxKQgMCOw8wqIouOv1s9sdsnFR/6uaxEC GOHVm1t4sQ7GsSyaRwvEVP/aB5SnRGWn6408TrOz7E/Jn2sabbqUB9Ordb2H8FP0Ss88mW8kE2O GNFLoqO6pDYyWYSvXKLsugRX5f17Zhth9sYOdKExC+60DIQg2SFQoQRXHGGSVPBDFu/eLBCxlx9 jOHJAUn2H18r9Amtf/jCtQG51NN+gJH/ndYTe9NkwKnQpjhiITpmpMdb6QjPMrDMs8MnrpY0xV6 tI= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Rspam-User: X-Stat-Signature: q7fsjrmgor3myy7img37rgtpignh5rx4 X-Rspamd-Server: rspam07 X-Rspamd-Queue-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MHf55VxMZspJVM+hPRsARMhKonfRlp2Su0w5j45/idYIi/EFMbCFSptkON8sG0mXda4+LccO0cqzBf8tT8jlc1kTp6rWtPK5aMM/BV0dSVihupbOCa2gPFRusE1UPUEDNU6TQGWhvQNfYau83XSGEGvciXmiW9e1stnOk/mdT2jzv8eNiG69SHRxfIA/zUt7tncYMB0k4QkwDkit+ejKe4k/PIbp3pNPEaXmu5CLPA1V002yDzgR/C4WISST8K8id8lQbVO1Wwj5rQcmCT4iU+2CEpX/qId2GEe1j/FSFatUzIefmkMOtHVWVvtCKv3Hlb0NhgqjpgzOIoPEWw0Z/8gDAoAQT1pIKFuNgPR2Qwq0kN5Wh264rM7uC/cY7p/27WKNDQaq4jAujr0zzd5eyDzi8eziToaNqYzQV2J+3mJzlfLM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados Erase the code comments mentioning "child" that were forgotten when the child element was removed in commit 2f2665c13af48 ("sysctl: replace child with an enumeration"). Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 29d40f0ff3ff..2ef23d2c3496 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1298,28 +1298,23 @@ static struct ctl_dir *sysctl_mkdir_p(struct ctl_dir *dir, const char *path) * __register_sysctl_table - register a leaf sysctl table * @set: Sysctl tree to register on * @path: The path to the directory the sysctl table is in. - * @table: the top-level table structure without any child. This table - * should not be free'd after registration. So it should not be - * used on stack. It can either be a global or dynamically allocated - * by the caller and free'd later after sysctl unregistration. + * + * @table: the top-level table structure. This table should not be free'd + * after registration. So it should not be used on stack. It can either + * be a global or dynamically allocated by the caller and free'd later + * after sysctl unregistration. * @table_size : The number of elements in table * * Register a sysctl table hierarchy. @table should be a filled in ctl_table * array. A completely 0 filled entry terminates the table. * * The members of the &struct ctl_table structure are used as follows: - * * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not * enter a sysctl file - * - * data - a pointer to data for use by proc_handler - * - * maxlen - the maximum size in bytes of the data - * - * mode - the file permissions for the /proc/sys file - * - * child - must be %NULL. - * + * data - a pointer to data for use by proc_handler + * maxlen - the maximum size in bytes of the data + * mode - the file permissions for the /proc/sys file + * type - Defines the target type (described in struct definition) * proc_handler - the text handler routine (described below) * * extra1, extra2 - extra pointers usable by the proc handler routines @@ -1327,8 +1322,7 @@ static struct ctl_dir *sysctl_mkdir_p(struct ctl_dir *dir, const char *path) * [0] https://lkml.kernel.org/87zgpte9o4.fsf@email.froward.int.ebiederm.org * * Leaf nodes in the sysctl tree will be represented by a single file - * under /proc; non-leaf nodes (where child is not NULL) are not allowed, - * sysctl_check_table() verifies this. + * under /proc; non-leaf nodes are not allowed. * * There must be a proc_handler routine for any terminal nodes. * Several default handlers are available to cover common cases - From patchwork Tue Jun 4 06:29:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 534F0C25B7E for ; Tue, 4 Jun 2024 06:30:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20A926B0092; Tue, 4 Jun 2024 02:30:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 192F26B0093; Tue, 4 Jun 2024 02:30:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED9A06B0098; Tue, 4 Jun 2024 02:30:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CA4236B0092 for ; Tue, 4 Jun 2024 02:30:05 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6E98D160C41 for ; Tue, 4 Jun 2024 06:30:05 +0000 (UTC) X-FDA: 82192231170.21.8D26FD7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 61A2F40011 for ; Tue, 4 Jun 2024 06:30:03 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YuRhARNo; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482603; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NWOaUyxVLI9q70yJMe6ojRA+5bF/JOGS+i4LybE/7qU=; b=B1ND6qgj6H55OwnW0aAM7nSGL952JJb6lzh0WZWyZgYEKi8m8f2k+Y8qUW0CRONlv2Dj9Y YTb90be7rIwf024YCqaDgyios+H8VoXQOZgyjrMPfFMLEZ/oQvJx1/bzP+aTcwdbY6Y/m+ x7ui9rcL5XNkfApZxUR20dyvQddGPyE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YuRhARNo; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482603; a=rsa-sha256; cv=none; b=xYmxYoyyf9GL3YVcpJ123FQwlut1A/JeChkPeEKagZg15U+guoThbSq55hphh9BlJLie0W mO7yB9LSkDFtnHqDiyegHdXHFDXaiI8FGD80mTDgmZ3kfU3Nq9d9qaEtGy/0hkh24YORbX +WxOOAG6pzUrNgpTxTCCRSTLkPxCY+8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B13526121E; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id E1B5EC4AF1C; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482600; bh=C/wJBaI+Nf//FLZ9qNdBqF9DbNgygnVG1KR7x04B2gE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YuRhARNoR25hcvBkcNAUTgIhqRJKKbjGFRg5liFLM0brTj9UeK2wwzFmJKrQxqamc YhMzrvdgZoCRZbKxCTWmdcZt2armObHFKIjVKcN1WF6i9MiP2m/MI7MpPSdr3xq4nA buulh7QU9cov1UYJgez+xfYAOHl9uM1tSLfzv+zZlxQY9KTT98QMdcX/neht+YmmeU H9B/eFwudfX3UzBWsvd+61dvQtpkEI3yt+h0Vjfk0gqmTsFoBqx86m44y1LZOhoNYC udGaz9SUc07Z1u4LvBlpX5M7ELIQxpco4xgdtKDzFgP3nkuvOc63yqwPmbmR2cff7t JJ6h+s+XI3Xkw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8318C27C54; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:25 +0200 Subject: [PATCH 7/8] sysctl: Remove ctl_table sentinel code comments MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-7-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=882; i=j.granados@samsung.com; h=from:subject:message-id; bh=zTe/Mj/k43FhBaGgdPaFYoMPRIHkDQfZ6H7/ug1O6Cc=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGUkSr3CVpnP54k/+9PHKhfTTA69nKuVw AbWrpNS33D41YkBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRlAAoJELqXzVK3 lkFPCvYMAIUVsRJA74OqhAoo95LSMr9pMo00Icg5tPkk1tZPCHQkgj4cL2Zu2V5jRGwRSkLxp5H IR0HctTp2+yGtKeGn8qj4XbwZ1GKTdx2q8M7n61gfVtpwl28bbKBSCCdOBFet1Z/RjdfO7qztoE iqAoUGKhJ4gsokBwKCrCTFgKTFDOD+B/B0cVwfcFRYVxtxTf5kmtg7MlAOY+Jtu/e8SLt85+h+G qgaRnRK7WRFMhZpfhgYzt02oNXWGlM/cmg/oo5Jbw/oEvgvrEngxgzuwmKQpfugA0KyBDBLyV0J xRQlthY/U1hjOXj80QnD1wSXjQe85phvjRlxf36FOsL+TjkQvUf0Qgk1WDbuYwHsJpxk3avhU7n iF/b0D1fc+BUB06Ux0PTitZBh39pLgo+UsK2yLw215oBiL9sRILV+rwI03Mr3BOyAsxWImkNmUY jVhQLyQ2SE7sBmT6Q6jBK9ea/2wQ2/WOFtIjQk0eGHHJy4Yvc8q3GoGbYPe3jxNFcKzMnX+Iuw6 GA= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 61A2F40011 X-Stat-Signature: 758cgkkbjaou5h93b5e1uak33hauwfa8 X-HE-Tag: 1717482603-351003 X-HE-Meta: U2FsdGVkX19+X+t9ZcFEgBuiGLV5bLUHXUrKTnt7xAunA/En73g0UrsVDd8Pd31wRrmslkTwBiXGKfcr81ZykgTSpzHvFX84Tdvjacz/7WqncFce+v8yRT8kVHbIO4vr/BKtUe/M77x0bllMHh86mwyUVgqcBUqXJo8GbmbSvosS4EKdLsBRsH8dAy3Y//x729bY1vp8gtjyd1KyD8ob/zzvCsRNzVdHhukUVRzT6yDKlm5E0f49g88NXjFaDr7YCYmb1UmcKCH+rEA+7/5QAM39XtlxuqbaAcOvxV5pMJQA+SGMu6xbJsLszH4sVKcjpXiEHD7TrpIYe0eitf/rmu003MpAlh6PlnNrd8EQUo8TtM4oZytvhtz3KOQauDwquoD01oQrSNlv+5669BVErFkh3pywoC5JVb3F/Zt2TsHNwYpM17zOXNMSOvfEpSmu/XJLWB/ILxE46de9+Wdx6K9V4QTEeA+c9DkzEnauJ0VdlNi5lk9Rsb/f7TNrxmOaIjIfzRRSpAjR5ABrOFDiMIhRgtbDdvV6hYkqV1b2bF4UseNLb5Wxe0IkYxu9PNj0bWjB6M/FsJjdtLGLYOGWOIxAZdTBlEVCECPQVMuYIkAK6uMbOJLq/XjWQbBn0ZY9QilW2RTv3/sQKdSRDKMgfc4WUYxSuOIpcS4SM8qJP8kCIlRmmuTqaQBrhnE4Bq55ypCpXg0SA3TcYHivQE0E6HmTNB8deRIDqjsY4ZGt3K4RnoVSCrbhl7x+62piK/LJ3bf2CZ5q0yjG7MS5xe5B2dU0v5vDBq3nDKg3ohtohmn7++e3bOKFp9YW3jHrsvFPvVltn326O0l0DL2tF1ANrgvgwFYpOne2ffSA2JBpNS2/I5hEL6VLgVl8rlKVrcjAAqitLQ/yM+CcjV5QKn0FgUGC0FoBYLlb1/JI0SCea7isjOhlDSwXn/1z4qk9YuwPY9YQrTI4Fni/OPdORd8 nJ6hgDtr MTQHk60OQS2KjwqNyLiyF6BOTlVufrwkWsy9BpLt0OfYddeIaI+g/AHn2NGvNyRf7v/mXaqQXFpmB0ORr1UK+/Jh3qDa/bDtPDuqClO6/6GfyEkxHygy0kff8CxzG6kMgs8jg+sDXsrkRQbqIzJWkBQUXuLKQZ6JzEZKf0T4IJJLgcJNKo0kmtO8tSJuxaYHEROw9zc70S4iNcKIdGdABZz9GT25pNDiZFMK9T3CthiC8NSzkBGDj2aOYIfxC+gs4KhK1fHE1OCnTexPdotGWmrY5uObFtoE39qF2Du+5Om1bj2Mr/+VF9dDW++08js9a+KL/o/yBlhyrKFsLdWziFTmvPq1ZV8OJlzjx0+/Hh3/VmtN0PoVJShDJkJPWWWuOFLBuL9oNlsRg5e3/oMHXuzN5XOpPLFzWhqiDZNDLL3mvGdk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados Remove the mention of a "zero terminated entry" from the __register_sysctl_table function doc. Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 2ef23d2c3496..806700b70dea 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1306,7 +1306,7 @@ static struct ctl_dir *sysctl_mkdir_p(struct ctl_dir *dir, const char *path) * @table_size : The number of elements in table * * Register a sysctl table hierarchy. @table should be a filled in ctl_table - * array. A completely 0 filled entry terminates the table. + * array. * * The members of the &struct ctl_table structure are used as follows: * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not From patchwork Tue Jun 4 06:29:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684736 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58033C25B7E for ; Tue, 4 Jun 2024 06:30:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48EA36B0093; Tue, 4 Jun 2024 02:30:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 342BF6B0099; Tue, 4 Jun 2024 02:30:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 037466B0096; Tue, 4 Jun 2024 02:30:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CB6516B0093 for ; Tue, 4 Jun 2024 02:30:05 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7C4661A016C for ; Tue, 4 Jun 2024 06:30:05 +0000 (UTC) X-FDA: 82192231170.14.503CC03 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 7151F140020 for ; Tue, 4 Jun 2024 06:30:03 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ov31VYfk; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482603; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/Mc+1B74ff0zjQK+kuIvwLivKGehEPsFT+YLaIGLv1s=; b=QKEBLIyLoLxtZYgD8BKSXHpDGhC6WVzLEUjRZneqVdu0+QyfizTfxl0iz0iRyk3d/nomx7 AD+h/Hkdlw7IGhI5e/7tsobnhvafd+5emiML5ksQDMhlblGtyvH2NBpifhhFJvZsM9fvEg Q8if8jGLprtltpu5Y1/sqePmLV72Ks4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482603; a=rsa-sha256; cv=none; b=4VI4v36tiUQ7ysvd4n0gn66JY/Rcr7MQMa2ONHrXDq9FH+bukNQBFCgKsNgTJ7zFSWqbPq lYGcOhRzV7ohmjV8gOZVmqt1E7FfZfFPX7KJuAIh2Iqcj/fQN60M653llzs3Inz8EjR0ze 02gfnwPUaL9Qx9HXw4q/j/QSFjLRcCo= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ov31VYfk; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DA69861220; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id EDCD8C4AF4D; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482600; bh=JGQT+4p7AHY1M4o7zhyH0qaV8X0DJMDz7KyqjSiOFsU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ov31VYfkZBszW6nagLY0k+JHZFiMxqJo3NcOel+En0isAe6LtNJ5y9FCZfVkctPXW 7LZXgH+PAQIjLBC9dyOCddavt9rrNFFKGGv6IMMcx3bY8Q7DqGre74pUdfLFZfUeNM hWdD2xN6klufntacPQjGZGfzu330vz/iZu8Nc3CaU4JkedUXKFzApi9J+FforQvK3M YIsRBX7BW2vwUnsRrgTn1x7qKJ1Af+hCmT3ykgBjrSZvvSwXqLZCZpZmizxPBxJYGG KGkvDazh0oyOkjL0uXlmsNAYBbMUKCvHSgZAiHOeVFQsshxaeKy8d+QttD2HlqsDLO QJJeoHRH5qHfA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4B6CC25B7E; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:26 +0200 Subject: [PATCH 8/8] sysctl: Warn on an empty procname element MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-8-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=837; i=j.granados@samsung.com; h=from:subject:message-id; bh=kiBCYRLAjKste0XuHE2np63NWadPBoIGUUndp1NrN98=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGXOjyV9+/Ko/a1TAa0g3yQtd6zwj6D29 kW6R7OTXh/JPokBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRlAAoJELqXzVK3 lkFPABkL/0chps6Tybj/Jceo6dk5TxaNFxxf/9U5ng/iiwgx4Aud25nQYC/AmsWbL/his/ClEv4 8BuIUh8G4fFijVL56/El1GEAVxd9J8z8s6c3d83lZ+7po/aWsz9lvgO6nh3tTe8U6TKKV+Rh0jL EKXjAJ+S4/CNLT4NBhCuIY4P4LyQIjgAxHx3p/ryNWc08tJJAK0bG+L3cllECbQ7X+usHu9Q9dq mg5tVGmxkunsrP/nLQNrlC+xpppGWp+fc5g9y/QeTAXHVHQMCZkeV5pJfgBWVGMUv9F7juRGJAB B5ySh3sHHaIo8scZIIYsRqWs1/4dR8vxgpa8iXykL41Px3oJuinO01eFG2gdAht/skleaLIIW5y k36ZfB4mYUmXBtSq/YEGDd4IerIixbbq7Hc5F+g+l7Eby59/gbzU06uOy3mGyuXFVzB0WHcZFiz +zN9loEzcIEe/WaIq9hQLiHtkj3fwCmwXLuAOl6RzQgKnNf/jXmyJJL30Dsd9/INhxAp1Tc7SA6 74= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Stat-Signature: xbrrxasxin1jtiz583uqnj1xsdnjgjma X-Rspamd-Queue-Id: 7151F140020 X-Rsp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3gDtZzRbFWD1HXgYHMTC2kDj/T7KhmD9bWBqJ1JjdgcYDWsYU7DZewFCesQb9MNlNRigIS27UpUr/PYTLma7xynPI9/yKiUAzz5lbcdLRenlYKQMe5QO88N9KyII9t0YBN0jK5IEmeXrdiC+FK+YCkDK6pKMk2E1MInlOnVXfRABH7zLy+POTedPLAX8cMRmgfOTBw/lqDjrzE6dW/wgufdNT96ieqnPuiZpKcKMTNQ2hXW9584N+/2cgsj8ZqB0WBPoGyjGj9ed1gqe4BXrvTc93gSXa7bQrssFZlpoe7HeZL5J4DfGdc9lTPWRtnFEZyGQukNSPkhHFMHVVZpIndgDXLVcg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados Add a pr_err warning in case a ctl_table is registered with a sentinel element containing a NULL procname. Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 806700b70dea..f65098de5fcb 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1119,6 +1119,8 @@ static int sysctl_check_table(const char *path, struct ctl_table_header *header) struct ctl_table *entry; int err = 0; list_for_each_table_entry(entry, header) { + if (!entry->procname) + err |= sysctl_err(path, entry, "procname is null"); if ((entry->proc_handler == proc_dostring) || (entry->proc_handler == proc_dobool) || (entry->proc_handler == proc_dointvec) ||