All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Granados <j.granados@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: <mcgrof@kernel.org>, Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Russ Weight <russell.h.weight@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Phillip Potter <phil@philpotter.co.uk>,
	Clemens Ladisch <clemens@ladisch.de>,
	Arnd Bergmann <arnd@arndb.de>, Corey Minyard <minyard@acm.org>,
	Theodore Ts'o <tytso@mit.edu>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Song Liu <song@kernel.org>, Robin Holt <robinmholt@gmail.com>,
	Steve Wahl <steve.wahl@hpe.com>, David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Doug Gilbert <dgilbert@interlog.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>,
	Benjamin LaHaise <bcrl@kvack.org>,
	David Howells <dhowells@redhat.com>,
	Jan Harkes <jaharkes@cs.cmu.edu>, <coda@cs.cmu.edu>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna@kernel.org>,
	Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>, Jan Kara <jack@suse.cz>,
	Anton Altaparmakov <anton@tuxera.com>,
	Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Kees Cook <keescook@chromium.org>,
	Iurii Zaikin <yzaikin@google.com>,
	Eric Biggers <ebiggers@kernel.org>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Balbir Singh <bsingharora@gmail.com>,
	Eric Biederman <ebiederm@xmission.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	John Stultz <jstultz@google.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Muchun Song <muchun.song@linux.dev>,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Joerg Reuter <jreuter@yaina.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Florian Westphal <fw@strlen.de>, Roopa Prabhu <roopa@nvidia.com>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	Mat Martineau <martineau@kernel.org>,
	Simon Horman <horms@verge.net.au>, Julian Anastasov <ja@ssi.bg>,
	Remi Denis-Courmont <courmisch@gmail.com>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	Marc Dionne <marc.dionne@auristor.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Xin Long <lucien.xin@gmail.com>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Jan Karcher <jaka@linux.ibm.com>, Jon Maloy <jmaloy@redhat.com>,
	Ying Xue <ying.xue@windriver.com>,
	Martin Schiller <ms@dev.tdt.de>,
	John Johansen <john.johansen@canonical.com>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Mike Travis <mike.travis@hpe.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Amir Goldstein <amir73il@gmail.com>,
	Matthew Bobrowski <repnop@google.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Yonghong Song <yhs@fb.com>, KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>, Waiman Long <longman@redhat.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	John Ogness <john.ogness@linutronix.de>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>, Stephen Boyd <sboyd@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-ia64@vger.kernel.org>,
	<linuxppc-dev@lists.ozlabs.org>, <linux-s390@vger.kernel.org>,
	<linux-crypto@vger.kernel.org>,
	<openipmi-developer@lists.sourceforge.net>,
	<intel-gfx@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-hyperv@vger.kernel.org>,
	<linux-rdma@vger.kernel.org>, <linux-raid@vger.kernel.org>,
	<netdev@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
	<xen-devel@lists.xenproject.org>, <linux-fsdevel@vger.kernel.org>,
	<linux-aio@kvack.org>, <linux-cachefs@redhat.com>,
	<codalist@telemann.coda.cs.cmu.edu>, <linux-mm@kvack.org>,
	<linux-nfs@vger.kernel.org>,
	<linux-ntfs-dev@lists.sourceforge.net>,
	<ocfs2-devel@oss.oracle.com>, <fsverity@lists.linux.dev>,
	<linux-xfs@vger.kernel.org>, <bpf@vger.kernel.org>,
	<kexec@lists.infradead.org>, <linux-trace-kernel@vger.kernel.org>,
	<linux-hams@vger.kernel.org>, <netfilter-devel@vger.kernel.org>,
	<coreteam@netfilter.org>, <bridge@lists.linux-foundation.org>,
	<dccp@vger.kernel.org>, <linux-wpan@vger.kernel.org>,
	<mptcp@lists.linux.dev>, <lvs-devel@vger.kernel.org>,
	<rds-devel@oss.oracle.com>, <linux-afs@lists.infradead.org>,
	<linux-sctp@vger.kernel.org>,
	<tipc-discussion@lists.sourceforge.net>,
	<linux-x25@vger.kernel.org>, <apparmor@lists.ubuntu.com>,
	<linux-security-module@vger.kernel.org>,
	<keyrings@vger.kernel.org>
Subject: Re: [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:43:48 +0200	[thread overview]
Message-ID: <20230621134348.rcdzl7fi7yq2uj6h@localhost> (raw)
In-Reply-To: <878rcd2by5.fsf@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4805 bytes --]

On Wed, Jun 21, 2023 at 04:15:46PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> >> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> >> > Remove the empty end element from all the arrays that are passed to the
> >> > register sysctl calls. In some files this means reducing the explicit
> >> > array size by one. Also make sure that we are using the size in
> >> > ctl_table_header instead of evaluating the .procname element.
> >> 
> >> Where's the harm in removing the end elements driver by driver? This is
> >> an unwieldy patch to handle.
> >
> > I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
> > * I could for example separate all the removes into separate commits and
> >   then have a final commit that removes the check for the empty element.
> >   But this will leave the tree in a state where the for loop will have
> >   undefined behavior when it looks for the empty end element. It might
> >   or might not work (probably not :) until the final commit where I fix
> >   that.
> >
> > * I could also change the logic that looks for the final element,
> >   commit that first and then remove the empty element one commit per
> >   driver after that. But then for all the arrays that still have an
> >   empty element, there would again be undefined behavior as it would
> >   think that the last element is valid (when it is really the sentinel).
> >
> > Any ideas on how to get around these?
> 
> First add size to the register calls, and allow the last one to be
> sentinel but do not require the sentinel.
> 
> Start removing sentinels, adjusting the size passed in.
This is a great idea! and I think I don't even have to adjust the size
because if I change the logic to stop on the sentinel or the size; so when
the sentinel is there, it will stop before the size. And when the
sentinel is not there, it will stop on the correct size.

There might be issues with indirection calls. And there might also be
lots of places where I need to adjust a for loop (as dan has pointed
out) but its worth a try for V2.

Best
> 
> Once enough sentinels have been removed, add warning if the final entry
> is a sentinel.
> 
> Never really remove the check? (But surely you can rework the logic to
> not count the number of elements up front, only while iterating.)
> 
> 
> BR,
> Jani.
> 
> >> 
> >> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> >> > index f43950219ffc..e4d7372afb10 100644
> >> > --- a/drivers/gpu/drm/i915/i915_perf.c
> >> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> >> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >> >  
> >> >  static struct ctl_table oa_table[] = {
> >> >  	{
> >> > -	 .procname = "perf_stream_paranoid",
> >> > -	 .data = &i915_perf_stream_paranoid,
> >> > -	 .maxlen = sizeof(i915_perf_stream_paranoid),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = SYSCTL_ONE,
> >> > -	 },
> >> > +		.procname = "perf_stream_paranoid",
> >> > +		.data = &i915_perf_stream_paranoid,
> >> > +		.maxlen = sizeof(i915_perf_stream_paranoid),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = SYSCTL_ONE,
> >> > +	},
> >> >  	{
> >> > -	 .procname = "oa_max_sample_rate",
> >> > -	 .data = &i915_oa_max_sample_rate,
> >> > -	 .maxlen = sizeof(i915_oa_max_sample_rate),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = &oa_sample_rate_hard_limit,
> >> > -	 },
> >> > -	{}
> >> > +		.procname = "oa_max_sample_rate",
> >> > +		.data = &i915_oa_max_sample_rate,
> >> > +		.maxlen = sizeof(i915_oa_max_sample_rate),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = &oa_sample_rate_hard_limit,
> >> > +	}
> >> >  };
> >> 
> >> The existing indentation is off, but fixing it doesn't really belong in
> >> this patch.
> >
> > Agreed. But I actually was trying to fix something that checkpatch
> > flagged. I'll change these back (which will cause this patch to be
> > flagged).
> >
> > An alternative solution would be to fix the indentation as part of the
> > preparation patches. Tell me what you think.
> >
> > Thx
> >
> >> 
> >> BR,
> >> Jani.
> >> 
> >> 
> >> -- 
> >> Jani Nikula, Intel Open Source Graphics Center
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Joel Granados via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	dri-devel@lists.freedesktop.org, Ben Segall <bsegall@google.com>,
	linux-sctp@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Wei Liu <wei.liu@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	bridge@lists.linux-foundation.org,
	James Morris <jmorris@namei.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-cachefs@redhat.com, Mel Gorman <mgorman@suse.de>,
	Waiman Long <longman@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Petr Mladek <pmladek@suse.com>, Martin Schiller <ms@dev.tdt.de>,
	Russ Weight <russell.h.weight@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	John Ogness <john.ogness@linutronix.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andy Lutomirski <luto@kernel.org>,
	Remi Denis-Courmont <courmisch@gmail.com>,
	xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anton Altaparmakov <anton@tuxera.com>,
	Christian Brauner <brauner@kernel.org>,
	Will Drewry <wad@chromium.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	mcgrof@kernel.org, Chuck Lever <chuck.lever@oracle.com>,
	netfilter-devel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	linux-trace-kernel@vger.kernel.org, linux-wpan@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	linux-aio@kvack.org, "Jason A. Donenfeld" <Jason@zx2c4.com>,
	linux-ia64@vger.kernel.org,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Clemens Ladisch <clemens@ladisch.de>,
	Phillip Potter <phil@philpotter.co.uk>,
	Song Liu <song@kernel.org>, Eric Dumazet <edumazet@google.com>,
	keyrings@vger.kernel.org, John Stultz <jstultz@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	Jan Karcher <jaka@linux.ibm.com>,
	codalist@telemann.coda.cs.cmu.edu, linux-s390@vger.kernel.org,
	Valentin Schneider <vschneid@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Corey Minyard <minyard@acm.org>,
	Leon Romanovsky <leon@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Will Deacon <will@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Mat Martineau <martineau@kernel.org>,
	Matthew Bobrowski <repnop@google.com>,
	Julian Anastasov <ja@ssi.bg>,
	coreteam@netfilter.org, Roopa Prabhu <roopa@nvidia.com>,
	Yonghong Song <yhs@fb.com>, Iurii Zaikin <yzaikin@google.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Mike Travis <mike.travis@hpe.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Simon Horman <horms@verge.net.au>,
	Xin Long <lucien.xin@gmail.com>,
	linux-arm-kernel@lists.infradead.org, fsverity@lists.linux.dev,
	Hao Luo <haoluo@google.com>, Theodore Ts'o <tytso@mit.edu>,
	Stephen Boyd <sboyd@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Florian Westphal <fw@strlen.de>,
	Robin Holt <robinmholt@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jon Maloy <jmaloy@redhat.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Anna Schumaker <anna@kernel.org>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-hams@vger.kernel.org,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Marc Dionne <marc.dionne@auristor.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-afs@lists.infradead.org,
	Daniel Borkmann <daniel@iogearbox.net>,
	linux-rdma@vger.kernel.org, Dexuan Cui <decui@microsoft.com>,
	lvs-devel@vger.kernel.org, coda@cs.cmu.edu,
	Doug Gilbert <dgilbert@interlog.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	intel-gfx@lists.freedesktop.org,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-crypto@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	openipmi-developer@lists.sourceforge.net, mptcp@lists.linux.dev,
	Jan Harkes <jaharkes@cs.cmu.edu>,
	linux-nfs@vger.kernel.org, linux-mm@kvack.org,
	Jeff Layton <jlayton@kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	linux-xfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net,
	netdev@vger.kernel.org, Ying Xue <ying.xue@windriver.com>,
	bpf@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Alexander Aring <alex.aring@gmail.com>, Jan Kara <jack@suse.cz>,
	Steve Wahl <steve.wahl@hpe.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Balbir Singh <bsingharora@gmail.com>,
	Amir Goldstein <amir73il@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	David Howells <dhowells@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	David Airlie <airlied@gmail.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	rds-devel@oss.oracle.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-scsi@vger.kernel.org, dccp@vger.kernel.org, x86@kernel.org,
	Russell King <linux@armlinux.org.uk>,
	Jason Gunthorpe <jgg@ziepe.ca>, Ingo Molnar <mingo@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Joerg Reuter <jreuter@yaina.de>,
	linux-hyperv@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	apparmor@lists.ubuntu.com, linux-raid@vger.kernel.org,
	Paul Moore <paul@paul-moore.com>, Juergen Gross <jgross@suse.com>,
	John Johansen <john.johansen@canonical.com>,
	linux-x25@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	David Ahern <dsahern@kernel.org>,
	kexec@lists.infradead.org, linux-security-module@vger.kernel.org,
	Benjamin LaHaise <bcrl@kvack.org>,
	tipc-discussion@lists.sourceforge.net,
	Daniel Vetter <daniel@ffwll.ch>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Karsten Graul <kgraul@linux.ibm.com>
Subject: Re: [Ocfs2-devel] [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:43:48 +0200	[thread overview]
Message-ID: <20230621134348.rcdzl7fi7yq2uj6h@localhost> (raw)
In-Reply-To: <878rcd2by5.fsf@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 4805 bytes --]

On Wed, Jun 21, 2023 at 04:15:46PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> >> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> >> > Remove the empty end element from all the arrays that are passed to the
> >> > register sysctl calls. In some files this means reducing the explicit
> >> > array size by one. Also make sure that we are using the size in
> >> > ctl_table_header instead of evaluating the .procname element.
> >> 
> >> Where's the harm in removing the end elements driver by driver? This is
> >> an unwieldy patch to handle.
> >
> > I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
> > * I could for example separate all the removes into separate commits and
> >   then have a final commit that removes the check for the empty element.
> >   But this will leave the tree in a state where the for loop will have
> >   undefined behavior when it looks for the empty end element. It might
> >   or might not work (probably not :) until the final commit where I fix
> >   that.
> >
> > * I could also change the logic that looks for the final element,
> >   commit that first and then remove the empty element one commit per
> >   driver after that. But then for all the arrays that still have an
> >   empty element, there would again be undefined behavior as it would
> >   think that the last element is valid (when it is really the sentinel).
> >
> > Any ideas on how to get around these?
> 
> First add size to the register calls, and allow the last one to be
> sentinel but do not require the sentinel.
> 
> Start removing sentinels, adjusting the size passed in.
This is a great idea! and I think I don't even have to adjust the size
because if I change the logic to stop on the sentinel or the size; so when
the sentinel is there, it will stop before the size. And when the
sentinel is not there, it will stop on the correct size.

There might be issues with indirection calls. And there might also be
lots of places where I need to adjust a for loop (as dan has pointed
out) but its worth a try for V2.

Best
> 
> Once enough sentinels have been removed, add warning if the final entry
> is a sentinel.
> 
> Never really remove the check? (But surely you can rework the logic to
> not count the number of elements up front, only while iterating.)
> 
> 
> BR,
> Jani.
> 
> >> 
> >> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> >> > index f43950219ffc..e4d7372afb10 100644
> >> > --- a/drivers/gpu/drm/i915/i915_perf.c
> >> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> >> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >> >  
> >> >  static struct ctl_table oa_table[] = {
> >> >  	{
> >> > -	 .procname = "perf_stream_paranoid",
> >> > -	 .data = &i915_perf_stream_paranoid,
> >> > -	 .maxlen = sizeof(i915_perf_stream_paranoid),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = SYSCTL_ONE,
> >> > -	 },
> >> > +		.procname = "perf_stream_paranoid",
> >> > +		.data = &i915_perf_stream_paranoid,
> >> > +		.maxlen = sizeof(i915_perf_stream_paranoid),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = SYSCTL_ONE,
> >> > +	},
> >> >  	{
> >> > -	 .procname = "oa_max_sample_rate",
> >> > -	 .data = &i915_oa_max_sample_rate,
> >> > -	 .maxlen = sizeof(i915_oa_max_sample_rate),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = &oa_sample_rate_hard_limit,
> >> > -	 },
> >> > -	{}
> >> > +		.procname = "oa_max_sample_rate",
> >> > +		.data = &i915_oa_max_sample_rate,
> >> > +		.maxlen = sizeof(i915_oa_max_sample_rate),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = &oa_sample_rate_hard_limit,
> >> > +	}
> >> >  };
> >> 
> >> The existing indentation is off, but fixing it doesn't really belong in
> >> this patch.
> >
> > Agreed. But I actually was trying to fix something that checkpatch
> > flagged. I'll change these back (which will cause this patch to be
> > flagged).
> >
> > An alternative solution would be to fix the indentation as part of the
> > preparation patches. Tell me what you think.
> >
> > Thx
> >
> >> 
> >> BR,
> >> Jani.
> >> 
> >> 
> >> -- 
> >> Jani Nikula, Intel Open Source Graphics Center
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 

Joel Granados

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

[-- Attachment #2: Type: text/plain, Size: 151 bytes --]

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

WARNING: multiple messages have this Message-ID (diff)
From: Joel Granados <j.granados@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	dri-devel@lists.freedesktop.org, Ben Segall <bsegall@google.com>,
	linux-sctp@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Wei Liu <wei.liu@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	bridge@lists.linux-foundation.org,
	James Morris <jmorris@namei.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-cachefs@redhat.com, Mel Gorman <mgorman@suse.de>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Petr Mladek <pmladek@suse.com>, Martin Schiller <ms@dev.tdt.de>,
	Russ Weight <russell.h.weight@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	John Ogness <john.ogness@linutronix.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andy Lutomirski <luto@kernel.org>,
	Remi Denis-Courmont <courmisch@gmail.com>,
	xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anton Altaparmakov <anton@tuxera.com>,
	Christian Brauner <brauner@kernel.org>,
	Will Drewry <wad@chromium.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	mcgrof@kernel.org, Chuck Lever <chuck.lever@oracle.com>,
	netfilter-devel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-trace-kernel@vger.kernel.org, linux-wpan@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	linux-aio@kvack.org, "Jason A. Donenfeld" <Jason@zx2c4.com>,
	linux-ia64@vger.kernel.org,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Clemens Ladisch <clemens@ladisch.de>,
	Phillip Potter <phil@philpotter.co.uk>,
	Song Liu <song@kernel.org>, Eric Dumazet <edumazet@google.com>,
	keyrings@vger.kernel.org, John Stultz <jstultz@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	Jan Karcher <jaka@linux.ibm.com>,
	codalist@telemann.coda.cs.cmu.edu, linux-s390@vger.kernel.org,
	Valentin Schneider <vschneid@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Corey Minyard <minyard@acm.org>,
	Leon Romanovsky <leon@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Will Deacon <will@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Mat Martineau <martineau@kernel.org>,
	Matthew Bobrowski <repnop@google.com>,
	Julian Anastasov <ja@ssi.bg>,
	coreteam@netfilter.org, Roopa Prabhu <roopa@nvidia.com>,
	Yonghong Song <yhs@fb.com>, Iurii Zaikin <yzaikin@google.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Mike Travis <mike.travis@hpe.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Simon Horman <horms@verge.net.au>,
	Xin Long <lucien.xin@gmail.com>,
	linux-arm-kernel@lists.infradead.org, fsverity@lists.linux.dev,
	Hao Luo <haoluo@google.com>, Theodore Ts'o <tytso@mit.edu>,
	Stephen Boyd <sboyd@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Florian Westphal <fw@strlen.de>,
	Robin Holt <robinmholt@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jon Maloy <jmaloy@redhat.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Anna Schumaker <anna@kernel.org>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	linux-hams@vger.kernel.org,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Marc  Dionne <marc.dionne@auristor.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-afs@lists.infradead.org,
	Daniel Borkmann <daniel@iogearbox.net>,
	linux-rdma@vger.kernel.org, Dexuan Cui <decui@microsoft.com>,
	"Matthew Wilcox \(Oracle\)" <willy@infradead.org>,
	lvs-devel@vger.kernel.org, coda@cs.cmu.edu,
	Doug Gilbert <dgilbert@interlog.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	intel-gfx@lists.freedesktop.org,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-crypto@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	openipmi-developer@lists.sourceforge.net, mptcp@lists.linux.dev,
	Jan Harkes <jaharkes@cs.cmu.edu>,
	linux-nfs@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-mm@kvack.org, Jeff Layton <jlayton@kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	linux-xfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net,
	netdev@vger.kernel.org, Ying Xue <ying.xue@windriver.com>,
	bpf@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Alexander Aring <alex.aring@gmail.com>, Jan Kara <jack@suse.cz>,
	Steve Wahl <steve.wahl@hpe.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Amir Goldstein <amir73il@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	David Howells <dhowells@redhat.com>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	David Airlie <airlied@gmail.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	rds-devel@oss.oracle.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-scsi@vger.kernel.org, dccp@vger.kernel.org,
	Mark Fasheh <mark@fasheh.com>,
	x86@kernel.org, Russell King <linux@armlinux.org.uk>,
	Jason Gunthorpe <jgg@ziepe.ca>, Ingo Molnar <mingo@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Joerg Reuter <jreuter@yaina.de>,
	linux-hyperv@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	apparmor@lists.ubuntu.com, linux-raid@vger.kernel.org,
	Paul Moore <paul@paul-moore.com>, Juergen Gross <jgross@suse.com>,
	John Johansen <john.johansen@canonical.com>,
	linux-x25@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	David Ahern <dsahern@kernel.org>,
	kexec@lists.infradead.org, linux-security-module@vger.kernel.org,
	Benjamin LaHaise <bcrl@kvack.org>,
	tipc-discussion@lists.sourceforge.net,
	Daniel Vetter <daniel@ffwll.ch>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Joel Becker <jlbec@evilplan.org>
Subject: Re: [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:43:48 +0200	[thread overview]
Message-ID: <20230621134348.rcdzl7fi7yq2uj6h@localhost> (raw)
In-Reply-To: <878rcd2by5.fsf@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4805 bytes --]

On Wed, Jun 21, 2023 at 04:15:46PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> >> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> >> > Remove the empty end element from all the arrays that are passed to the
> >> > register sysctl calls. In some files this means reducing the explicit
> >> > array size by one. Also make sure that we are using the size in
> >> > ctl_table_header instead of evaluating the .procname element.
> >> 
> >> Where's the harm in removing the end elements driver by driver? This is
> >> an unwieldy patch to handle.
> >
> > I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
> > * I could for example separate all the removes into separate commits and
> >   then have a final commit that removes the check for the empty element.
> >   But this will leave the tree in a state where the for loop will have
> >   undefined behavior when it looks for the empty end element. It might
> >   or might not work (probably not :) until the final commit where I fix
> >   that.
> >
> > * I could also change the logic that looks for the final element,
> >   commit that first and then remove the empty element one commit per
> >   driver after that. But then for all the arrays that still have an
> >   empty element, there would again be undefined behavior as it would
> >   think that the last element is valid (when it is really the sentinel).
> >
> > Any ideas on how to get around these?
> 
> First add size to the register calls, and allow the last one to be
> sentinel but do not require the sentinel.
> 
> Start removing sentinels, adjusting the size passed in.
This is a great idea! and I think I don't even have to adjust the size
because if I change the logic to stop on the sentinel or the size; so when
the sentinel is there, it will stop before the size. And when the
sentinel is not there, it will stop on the correct size.

There might be issues with indirection calls. And there might also be
lots of places where I need to adjust a for loop (as dan has pointed
out) but its worth a try for V2.

Best
> 
> Once enough sentinels have been removed, add warning if the final entry
> is a sentinel.
> 
> Never really remove the check? (But surely you can rework the logic to
> not count the number of elements up front, only while iterating.)
> 
> 
> BR,
> Jani.
> 
> >> 
> >> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> >> > index f43950219ffc..e4d7372afb10 100644
> >> > --- a/drivers/gpu/drm/i915/i915_perf.c
> >> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> >> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >> >  
> >> >  static struct ctl_table oa_table[] = {
> >> >  	{
> >> > -	 .procname = "perf_stream_paranoid",
> >> > -	 .data = &i915_perf_stream_paranoid,
> >> > -	 .maxlen = sizeof(i915_perf_stream_paranoid),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = SYSCTL_ONE,
> >> > -	 },
> >> > +		.procname = "perf_stream_paranoid",
> >> > +		.data = &i915_perf_stream_paranoid,
> >> > +		.maxlen = sizeof(i915_perf_stream_paranoid),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = SYSCTL_ONE,
> >> > +	},
> >> >  	{
> >> > -	 .procname = "oa_max_sample_rate",
> >> > -	 .data = &i915_oa_max_sample_rate,
> >> > -	 .maxlen = sizeof(i915_oa_max_sample_rate),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = &oa_sample_rate_hard_limit,
> >> > -	 },
> >> > -	{}
> >> > +		.procname = "oa_max_sample_rate",
> >> > +		.data = &i915_oa_max_sample_rate,
> >> > +		.maxlen = sizeof(i915_oa_max_sample_rate),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = &oa_sample_rate_hard_limit,
> >> > +	}
> >> >  };
> >> 
> >> The existing indentation is off, but fixing it doesn't really belong in
> >> this patch.
> >
> > Agreed. But I actually was trying to fix something that checkpatch
> > flagged. I'll change these back (which will cause this patch to be
> > flagged).
> >
> > An alternative solution would be to fix the indentation as part of the
> > preparation patches. Tell me what you think.
> >
> > Thx
> >
> >> 
> >> BR,
> >> Jani.
> >> 
> >> 
> >> -- 
> >> Jani Nikula, Intel Open Source Graphics Center
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Joel Granados <j.granados@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	dri-devel@lists.freedesktop.org, Ben Segall <bsegall@google.com>,
	linux-sctp@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Wei Liu <wei.liu@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	bridge@lists.linux-foundation.org,
	James Morris <jmorris@namei.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-cachefs@redhat.com, Mel Gorman <mgorman@suse.de>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Petr Mladek <pmladek@suse.com>, Martin Schiller <ms@dev.tdt.de>,
	Russ Weight <russell.h.weight@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	John Ogness <john.ogness@linutronix.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andy Lutomirski <luto@kernel.org>,
	Remi Denis-Courmont <courmisch@gmail.com>,
	xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anton Altaparmakov <anton@tuxera.com>,
	Christian Brauner <brauner@kernel.org>,
	Will Drewry <wad@chromium.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	mcgrof@kernel.org, Chuck Lever <chuck.lever@oracle.com>,
	netfilter-devel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-trace-kernel@vger.kernel.org, linux-wpan@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	linux-aio@kvack.org, "Jason A. Donenfeld" <Jason@zx2c4.com>,
	linux-ia64@vger.kernel.org,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Clemens Ladisch <clemens@ladisch.de>,
	Phillip Potter <phil@philpotter.co.uk>,
	Song Liu <song@kernel.org>, Eric Dumazet <edumazet@google.com>,
	keyrings@vger.kernel.org, John Stultz <jstultz@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	Jan Karcher <jaka@linux.ibm.com>,
	codalist@telemann.coda.cs.cmu.edu, linux-s390@vger.kernel.org,
	Valentin Schneider <vschneid@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Corey Minyard <minyard@acm.org>,
	Leon Romanovsky <leon@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Will Deacon <will@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Mat Martineau <martineau@kernel.org>,
	Matthew Bobrowski <repnop@google.com>,
	Julian Anastasov <ja@ssi.bg>,
	coreteam@netfilter.org, Roopa Prabhu <roopa@nvidia.com>,
	Yonghong Song <yhs@fb.com>, Iurii Zaikin <yzaikin@google.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Mike Travis <mike.travis@hpe.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Simon Horman <horms@verge.net.au>,
	Xin Long <lucien.xin@gmail.com>,
	linux-arm-kernel@lists.infradead.org, fsverity@lists.linux.dev,
	Hao Luo <haoluo@google.com>, Theodore Ts'o <tytso@mit.edu>,
	Stephen Boyd <sboyd@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Florian Westphal <fw@strlen.de>,
	Robin Holt <robinmholt@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jon Maloy <jmaloy@redhat.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Anna Schumaker <anna@kernel.org>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	linux-hams@vger.kernel.org,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Marc Dionne <marc.dionne@auristor.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-afs@lists.infradead.org,
	Daniel Borkmann <daniel@iogearbox.net>,
	linux-rdma@vger.kernel.org, Dexuan Cui <decui@microsoft.com>,
	"Matthew Wilcox \(Oracle\)" <willy@infradead.org>,
	lvs-devel@vger.kernel.org, coda@cs.cmu.edu,
	Doug Gilbert <dgilbert@interlog.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	intel-gfx@lists.freedesktop.org,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-crypto@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	openipmi-developer@lists.sourceforge.net, mptcp@lists.linux.dev,
	Jan Harkes <jaharkes@cs.cmu.edu>,
	linux-nfs@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-mm@kvack.org, Jeff Layton <jlayton@kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	linux-xfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net,
	netdev@vger.kernel.org, Ying Xue <ying.xue@windriver.com>,
	bpf@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Alexander Aring <alex.aring@gmail.com>, Jan Kara <jack@suse.cz>,
	Steve Wahl <steve.wahl@hpe.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Balbir Singh <bsingharora@gmail.com>,
	Amir Goldstein <amir73il@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	David Howells <dhowells@redhat.com>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	rds-devel@oss.oracle.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-scsi@vger.kernel.org, dccp@vger.kernel.org,
	Mark Fasheh <mark@fasheh.com>,
	x86@kernel.org, Russell King <linux@armlinux.org.uk>,
	Jason Gunthorpe <jgg@ziepe.ca>, Ingo Molnar <mingo@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Joerg Reuter <jreuter@yaina.de>,
	linux-hyperv@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	apparmor@lists.ubuntu.com, linux-raid@vger.kernel.org,
	Paul Moore <paul@paul-moore.com>, Juergen Gross <jgross@suse.com>,
	John Johansen <john.johansen@canonical.com>,
	linux-x25@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	David Ahern <dsahern@kernel.org>,
	kexec@lists.infradead.org, linux-security-module@vger.kernel.org,
	Benjamin LaHaise <bcrl@kvack.org>,
	tipc-discussion@lists.sourceforge.net,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Joel Becker <jlbec@evilplan.org>
Subject: Re: [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:43:48 +0200	[thread overview]
Message-ID: <20230621134348.rcdzl7fi7yq2uj6h@localhost> (raw)
In-Reply-To: <878rcd2by5.fsf@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4805 bytes --]

On Wed, Jun 21, 2023 at 04:15:46PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> >> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> >> > Remove the empty end element from all the arrays that are passed to the
> >> > register sysctl calls. In some files this means reducing the explicit
> >> > array size by one. Also make sure that we are using the size in
> >> > ctl_table_header instead of evaluating the .procname element.
> >> 
> >> Where's the harm in removing the end elements driver by driver? This is
> >> an unwieldy patch to handle.
> >
> > I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
> > * I could for example separate all the removes into separate commits and
> >   then have a final commit that removes the check for the empty element.
> >   But this will leave the tree in a state where the for loop will have
> >   undefined behavior when it looks for the empty end element. It might
> >   or might not work (probably not :) until the final commit where I fix
> >   that.
> >
> > * I could also change the logic that looks for the final element,
> >   commit that first and then remove the empty element one commit per
> >   driver after that. But then for all the arrays that still have an
> >   empty element, there would again be undefined behavior as it would
> >   think that the last element is valid (when it is really the sentinel).
> >
> > Any ideas on how to get around these?
> 
> First add size to the register calls, and allow the last one to be
> sentinel but do not require the sentinel.
> 
> Start removing sentinels, adjusting the size passed in.
This is a great idea! and I think I don't even have to adjust the size
because if I change the logic to stop on the sentinel or the size; so when
the sentinel is there, it will stop before the size. And when the
sentinel is not there, it will stop on the correct size.

There might be issues with indirection calls. And there might also be
lots of places where I need to adjust a for loop (as dan has pointed
out) but its worth a try for V2.

Best
> 
> Once enough sentinels have been removed, add warning if the final entry
> is a sentinel.
> 
> Never really remove the check? (But surely you can rework the logic to
> not count the number of elements up front, only while iterating.)
> 
> 
> BR,
> Jani.
> 
> >> 
> >> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> >> > index f43950219ffc..e4d7372afb10 100644
> >> > --- a/drivers/gpu/drm/i915/i915_perf.c
> >> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> >> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >> >  
> >> >  static struct ctl_table oa_table[] = {
> >> >  	{
> >> > -	 .procname = "perf_stream_paranoid",
> >> > -	 .data = &i915_perf_stream_paranoid,
> >> > -	 .maxlen = sizeof(i915_perf_stream_paranoid),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = SYSCTL_ONE,
> >> > -	 },
> >> > +		.procname = "perf_stream_paranoid",
> >> > +		.data = &i915_perf_stream_paranoid,
> >> > +		.maxlen = sizeof(i915_perf_stream_paranoid),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = SYSCTL_ONE,
> >> > +	},
> >> >  	{
> >> > -	 .procname = "oa_max_sample_rate",
> >> > -	 .data = &i915_oa_max_sample_rate,
> >> > -	 .maxlen = sizeof(i915_oa_max_sample_rate),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = &oa_sample_rate_hard_limit,
> >> > -	 },
> >> > -	{}
> >> > +		.procname = "oa_max_sample_rate",
> >> > +		.data = &i915_oa_max_sample_rate,
> >> > +		.maxlen = sizeof(i915_oa_max_sample_rate),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = &oa_sample_rate_hard_limit,
> >> > +	}
> >> >  };
> >> 
> >> The existing indentation is off, but fixing it doesn't really belong in
> >> this patch.
> >
> > Agreed. But I actually was trying to fix something that checkpatch
> > flagged. I'll change these back (which will cause this patch to be
> > flagged).
> >
> > An alternative solution would be to fix the indentation as part of the
> > preparation patches. Tell me what you think.
> >
> > Thx
> >
> >> 
> >> BR,
> >> Jani.
> >> 
> >> 
> >> -- 
> >> Jani Nikula, Intel Open Source Graphics Center
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Joel Granados <j.granados@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	dri-devel@lists.freedesktop.org, Ben Segall <bsegall@google.com>,
	linux-sctp@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Wei Liu <wei.liu@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	bridge@lists.linux-foundation.org,
	James Morris <jmorris@namei.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-cachefs@redhat.com, Mel Gorman <mgorman@suse.de>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Petr Mladek <pmladek@suse.com>, Martin Schiller <ms@dev.tdt.de>,
	Russ Weight <russell.h.weight@intel.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	John Ogness <john.ogness@linutronix.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andy Lutomirski <luto@kernel.org>,
	Remi Denis-Courmont <courmisch@gmail.com>,
	xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anton Altaparmakov <anton@tuxera.com>,
	Christian Brauner <brauner@kernel.org>,
	Will Drewry <wad@chromium.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	mcgrof@kernel.org, Chuck Lever <chuck.lever@oracle.com>,
	netfilter-devel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-trace-kernel@vger.kernel.org, linux-wpan@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	linux-aio@kvack.org, "Jason A. Donenfeld" <Jason@zx2c4.com>,
	linux-ia64@vger.kernel.org,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Clemens Ladisch <clemens@ladisch.de>,
	Phillip Potter <phil@philpotter.co.uk>,
	Song Liu <song@kernel.org>, Eric Dumazet <edumazet@google.com>,
	keyrings@vger.kernel.org, John Stultz <jstultz@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	Jan Karcher <jaka@linux.ibm.com>,
	codalist@telemann.coda.cs.cmu.edu, linux-s390@vger.kernel.org,
	Valentin Schneider <vschneid@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Corey Minyard <minyard@acm.org>,
	Leon Romanovsky <leon@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Will Deacon <will@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Mat Martineau <martineau@kernel.org>,
	Matthew Bobrowski <repnop@google.com>,
	Julian Anastasov <ja@ssi.bg>,
	coreteam@netfilter.org, Roopa Prabhu <roopa@nvidia.com>,
	Yonghong Song <yhs@fb.com>, Iurii Zaikin <yzaikin@google.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Mike Travis <mike.travis@hpe.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Simon Horman <horms@verge.net.au>,
	Xin Long <lucien.xin@gmail.com>,
	linux-arm-kernel@lists.infradead.org, fsverity@lists.linux.dev,
	Hao Luo <haoluo@google.com>, Theodore Ts'o <tytso@mit.edu>,
	Stephen Boyd <sboyd@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Florian Westphal <fw@strlen.de>,
	Robin Holt <robinmholt@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jon Maloy <jmaloy@redhat.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Anna Schumaker <anna@kernel.org>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-hams@vger.kernel.org,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Marc Dionne <marc.dionne@auristor.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-afs@lists.infradead.org,
	Daniel Borkmann <daniel@iogearbox.net>,
	linux-rdma@vger.kernel.org, Dexuan Cui <decui@microsoft.com>,
	"Matthew Wilcox \(Oracle\)" <willy@infradead.org>,
	lvs-devel@vger.kernel.org, coda@cs.cmu.edu,
	Doug Gilbert <dgilbert@interlog.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	intel-gfx@lists.freedesktop.org,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-crypto@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	openipmi-developer@lists.sourceforge.net, mptcp@lists.linux.dev,
	Jan Harkes <jaharkes@cs.cmu.edu>,
	linux-nfs@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-mm@kvack.org, Jeff Layton <jlayton@kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	linux-xfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net,
	netdev@vger.kernel.org, Ying Xue <ying.xue@windriver.com>,
	bpf@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Alexander Aring <alex.aring@gmail.com>, Jan Kara <jack@suse.cz>,
	Steve Wahl <steve.wahl@hpe.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Balbir Singh <bsingharora@gmail.com>,
	Amir Goldstein <amir73il@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	David Howells <dhowells@redhat.com>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	David Airlie <airlied@gmail.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	rds-devel@oss.oracle.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-scsi@vger.kernel.org, dccp@vger.kernel.org,
	Mark Fasheh <mark@fasheh.com>,
	x86@kernel.org, Russell King <linux@armlinux.org.uk>,
	Jason Gunthorpe <jgg@ziepe.ca>, Ingo Molnar <mingo@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Joerg Reuter <jreuter@yaina.de>,
	linux-hyperv@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	apparmor@lists.ubuntu.com, linux-raid@vger.kernel.org,
	Paul Moore <paul@paul-moore.com>, Juergen Gross <jgross@suse.com>,
	John Johansen <john.johansen@canonical.com>,
	linux-x25@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	David Ahern <dsahern@kernel.org>,
	kexec@lists.infradead.org, linux-security-module@vger.kernel.org,
	Benjamin LaHaise <bcrl@kvack.org>,
	tipc-discussion@lists.sourceforge.net,
	Daniel Vetter <daniel@ffwll.ch>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Joel Becker <jlbec@evilplan.org>
Subject: Re: [Intel-gfx] [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:43:48 +0200	[thread overview]
Message-ID: <20230621134348.rcdzl7fi7yq2uj6h@localhost> (raw)
In-Reply-To: <878rcd2by5.fsf@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4805 bytes --]

On Wed, Jun 21, 2023 at 04:15:46PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> >> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> >> > Remove the empty end element from all the arrays that are passed to the
> >> > register sysctl calls. In some files this means reducing the explicit
> >> > array size by one. Also make sure that we are using the size in
> >> > ctl_table_header instead of evaluating the .procname element.
> >> 
> >> Where's the harm in removing the end elements driver by driver? This is
> >> an unwieldy patch to handle.
> >
> > I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
> > * I could for example separate all the removes into separate commits and
> >   then have a final commit that removes the check for the empty element.
> >   But this will leave the tree in a state where the for loop will have
> >   undefined behavior when it looks for the empty end element. It might
> >   or might not work (probably not :) until the final commit where I fix
> >   that.
> >
> > * I could also change the logic that looks for the final element,
> >   commit that first and then remove the empty element one commit per
> >   driver after that. But then for all the arrays that still have an
> >   empty element, there would again be undefined behavior as it would
> >   think that the last element is valid (when it is really the sentinel).
> >
> > Any ideas on how to get around these?
> 
> First add size to the register calls, and allow the last one to be
> sentinel but do not require the sentinel.
> 
> Start removing sentinels, adjusting the size passed in.
This is a great idea! and I think I don't even have to adjust the size
because if I change the logic to stop on the sentinel or the size; so when
the sentinel is there, it will stop before the size. And when the
sentinel is not there, it will stop on the correct size.

There might be issues with indirection calls. And there might also be
lots of places where I need to adjust a for loop (as dan has pointed
out) but its worth a try for V2.

Best
> 
> Once enough sentinels have been removed, add warning if the final entry
> is a sentinel.
> 
> Never really remove the check? (But surely you can rework the logic to
> not count the number of elements up front, only while iterating.)
> 
> 
> BR,
> Jani.
> 
> >> 
> >> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> >> > index f43950219ffc..e4d7372afb10 100644
> >> > --- a/drivers/gpu/drm/i915/i915_perf.c
> >> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> >> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >> >  
> >> >  static struct ctl_table oa_table[] = {
> >> >  	{
> >> > -	 .procname = "perf_stream_paranoid",
> >> > -	 .data = &i915_perf_stream_paranoid,
> >> > -	 .maxlen = sizeof(i915_perf_stream_paranoid),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = SYSCTL_ONE,
> >> > -	 },
> >> > +		.procname = "perf_stream_paranoid",
> >> > +		.data = &i915_perf_stream_paranoid,
> >> > +		.maxlen = sizeof(i915_perf_stream_paranoid),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = SYSCTL_ONE,
> >> > +	},
> >> >  	{
> >> > -	 .procname = "oa_max_sample_rate",
> >> > -	 .data = &i915_oa_max_sample_rate,
> >> > -	 .maxlen = sizeof(i915_oa_max_sample_rate),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = &oa_sample_rate_hard_limit,
> >> > -	 },
> >> > -	{}
> >> > +		.procname = "oa_max_sample_rate",
> >> > +		.data = &i915_oa_max_sample_rate,
> >> > +		.maxlen = sizeof(i915_oa_max_sample_rate),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = &oa_sample_rate_hard_limit,
> >> > +	}
> >> >  };
> >> 
> >> The existing indentation is off, but fixing it doesn't really belong in
> >> this patch.
> >
> > Agreed. But I actually was trying to fix something that checkpatch
> > flagged. I'll change these back (which will cause this patch to be
> > flagged).
> >
> > An alternative solution would be to fix the indentation as part of the
> > preparation patches. Tell me what you think.
> >
> > Thx
> >
> >> 
> >> BR,
> >> Jani.
> >> 
> >> 
> >> -- 
> >> Jani Nikula, Intel Open Source Graphics Center
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Joel Granados <j.granados@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	dri-devel@lists.freedesktop.org, Ben Segall <bsegall@google.com>,
	linux-sctp@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Wei Liu <wei.liu@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	bridge@lists.linux-foundation.org,
	James Morris <jmorris@namei.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-cachefs@redhat.com, Mel Gorman <mgorman@suse.de>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Waiman Long <longman@redhat.co>
Subject: Re: [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:43:48 +0200	[thread overview]
Message-ID: <20230621134348.rcdzl7fi7yq2uj6h@localhost> (raw)
In-Reply-To: <878rcd2by5.fsf@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 4805 bytes --]

On Wed, Jun 21, 2023 at 04:15:46PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> >> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> >> > Remove the empty end element from all the arrays that are passed to the
> >> > register sysctl calls. In some files this means reducing the explicit
> >> > array size by one. Also make sure that we are using the size in
> >> > ctl_table_header instead of evaluating the .procname element.
> >> 
> >> Where's the harm in removing the end elements driver by driver? This is
> >> an unwieldy patch to handle.
> >
> > I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
> > * I could for example separate all the removes into separate commits and
> >   then have a final commit that removes the check for the empty element.
> >   But this will leave the tree in a state where the for loop will have
> >   undefined behavior when it looks for the empty end element. It might
> >   or might not work (probably not :) until the final commit where I fix
> >   that.
> >
> > * I could also change the logic that looks for the final element,
> >   commit that first and then remove the empty element one commit per
> >   driver after that. But then for all the arrays that still have an
> >   empty element, there would again be undefined behavior as it would
> >   think that the last element is valid (when it is really the sentinel).
> >
> > Any ideas on how to get around these?
> 
> First add size to the register calls, and allow the last one to be
> sentinel but do not require the sentinel.
> 
> Start removing sentinels, adjusting the size passed in.
This is a great idea! and I think I don't even have to adjust the size
because if I change the logic to stop on the sentinel or the size; so when
the sentinel is there, it will stop before the size. And when the
sentinel is not there, it will stop on the correct size.

There might be issues with indirection calls. And there might also be
lots of places where I need to adjust a for loop (as dan has pointed
out) but its worth a try for V2.

Best
> 
> Once enough sentinels have been removed, add warning if the final entry
> is a sentinel.
> 
> Never really remove the check? (But surely you can rework the logic to
> not count the number of elements up front, only while iterating.)
> 
> 
> BR,
> Jani.
> 
> >> 
> >> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> >> > index f43950219ffc..e4d7372afb10 100644
> >> > --- a/drivers/gpu/drm/i915/i915_perf.c
> >> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> >> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >> >  
> >> >  static struct ctl_table oa_table[] = {
> >> >  	{
> >> > -	 .procname = "perf_stream_paranoid",
> >> > -	 .data = &i915_perf_stream_paranoid,
> >> > -	 .maxlen = sizeof(i915_perf_stream_paranoid),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = SYSCTL_ONE,
> >> > -	 },
> >> > +		.procname = "perf_stream_paranoid",
> >> > +		.data = &i915_perf_stream_paranoid,
> >> > +		.maxlen = sizeof(i915_perf_stream_paranoid),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = SYSCTL_ONE,
> >> > +	},
> >> >  	{
> >> > -	 .procname = "oa_max_sample_rate",
> >> > -	 .data = &i915_oa_max_sample_rate,
> >> > -	 .maxlen = sizeof(i915_oa_max_sample_rate),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = &oa_sample_rate_hard_limit,
> >> > -	 },
> >> > -	{}
> >> > +		.procname = "oa_max_sample_rate",
> >> > +		.data = &i915_oa_max_sample_rate,
> >> > +		.maxlen = sizeof(i915_oa_max_sample_rate),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = &oa_sample_rate_hard_limit,
> >> > +	}
> >> >  };
> >> 
> >> The existing indentation is off, but fixing it doesn't really belong in
> >> this patch.
> >
> > Agreed. But I actually was trying to fix something that checkpatch
> > flagged. I'll change these back (which will cause this patch to be
> > flagged).
> >
> > An alternative solution would be to fix the indentation as part of the
> > preparation patches. Tell me what you think.
> >
> > Thx
> >
> >> 
> >> BR,
> >> Jani.
> >> 
> >> 
> >> -- 
> >> Jani Nikula, Intel Open Source Graphics Center
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 

Joel Granados

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 185 bytes --]

_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

WARNING: multiple messages have this Message-ID (diff)
From: Joel Granados <j.granados@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Juri Lelli <juri.lelli@redhat.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	dri-devel@lists.freedesktop.org, Ben Segall <bsegall@google.com>,
	linux-sctp@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Wei Liu <wei.liu@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	bridge@lists.linux-foundation.org,
	James Morris <jmorris@namei.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-cachefs@redhat.com, Mel Gorman <mgorman@suse.de>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Petr Mladek <pmladek@suse.com>, Martin Schiller <ms@dev.tdt.de>,
	Russ Weight <russell.h.weight@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	John Ogness <john.ogness@linutronix.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andy Lutomirski <luto@kernel.org>,
	Remi Denis-Courmont <courmisch@gmail.com>,
	xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anton Altaparmakov <anton@tuxera.com>,
	Christian Brauner <brauner@kernel.org>,
	Will Drewry <wad@chromium.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	mcgrof@kernel.org, Chuck Lever <chuck.lever@oracle.com>,
	netfilter-devel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-trace-kernel@vger.kernel.org, linux-wpan@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	linux-aio@kvack.org, "Jason A. Donenfeld" <Jason@zx2c4.com>,
	linux-ia64@vger.kernel.org,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Clemens Ladisch <clemens@ladisch.de>,
	Phillip Potter <phil@philpotter.co.uk>,
	Song Liu <song@kernel.org>, Eric Dumazet <edumazet@google.com>,
	keyrings@vger.kernel.org, John Stultz <jstultz@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	Jan Karcher <jaka@linux.ibm.com>,
	codalist@telemann.coda.cs.cmu.edu, linux-s390@vger.kernel.org,
	Valentin Schneider <vschneid@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Corey Minyard <minyard@acm.org>,
	Leon Romanovsky <leon@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Will Deacon <will@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Mat Martineau <martineau@kernel.org>,
	Matthew Bobrowski <repnop@google.com>,
	Julian Anastasov <ja@ssi.bg>,
	coreteam@netfilter.org, Roopa Prabhu <roopa@nvidia.com>,
	Yonghong Song <yhs@fb.com>, Iurii Zaikin <yzaikin@google.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Mike Travis <mike.travis@hpe.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Simon Horman <horms@verge.net.au>,
	Xin Long <lucien.xin@gmail.com>,
	linux-arm-kernel@lists.infradead.org, fsverity@lists.linux.dev,
	Hao Luo <haoluo@google.com>, Theodore Ts'o <tytso@mit.edu>,
	Stephen Boyd <sboyd@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Florian Westphal <fw@strlen.de>,
	Robin Holt <robinmholt@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jon Maloy <jmaloy@redhat.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	Anna Schumaker <anna@kernel.org>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-hams@vger.kernel.org,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Marc Dionne <marc.dionne@auristor.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-afs@lists.infradead.org,
	Daniel Borkmann <daniel@iogearbox.net>,
	linux-rdma@vger.kernel.org, Dexuan Cui <decui@microsoft.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	lvs-devel@vger.kernel.org, coda@cs.cmu.edu,
	Doug Gilbert <dgilbert@interlog.com>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	intel-gfx@lists.freedesktop.org,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-crypto@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	openipmi-developer@lists.sourceforge.net, mptcp@lists.linux.dev,
	Jan Harkes <jaharkes@cs.cmu.edu>,
	linux-nfs@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-mm@kvack.org, Jeff Layton <jlayton@kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	linux-xfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net,
	netdev@vger.kernel.org, Ying Xue <ying.xue@windriver.com>,
	bpf@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Alexander Aring <alex.aring@gmail.com>, Jan Kara <jack@suse.cz>,
	Steve Wahl <steve.wahl@hpe.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Balbir Singh <bsingharora@gmail.com>,
	Amir Goldstein <amir73il@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	David Howells <dhowells@redhat.com>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	David Airlie <airlied@gmail.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	rds-devel@oss.oracle.com,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-scsi@vger.kernel.org, dccp@vger.kernel.org,
	Mark Fasheh <mark@fasheh.com>,
	x86@kernel.org, Russell King <linux@armlinux.org.uk>,
	Jason Gunthorpe <jgg@ziepe.ca>, Ingo Molnar <mingo@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Joerg Reuter <jreuter@yaina.de>,
	linux-hyperv@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	apparmor@lists.ubuntu.com, linux-raid@vger.kernel.org,
	Paul Moore <paul@paul-moore.com>, Juergen Gross <jgross@suse.com>,
	John Johansen <john.johansen@canonical.com>,
	linux-x25@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	David Ahern <dsahern@kernel.org>,
	kexec@lists.infradead.org, linux-security-module@vger.kernel.org,
	Benjamin LaHaise <bcrl@kvack.org>,
	tipc-discussion@lists.sourceforge.net,
	Daniel Vetter <daniel@ffwll.ch>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Karsten Graul <kgraul@linux.ibm.com>,
	Joel Becker <jlbec@evilplan.org>
Subject: Re: [Bridge] [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays
Date: Wed, 21 Jun 2023 15:43:48 +0200	[thread overview]
Message-ID: <20230621134348.rcdzl7fi7yq2uj6h@localhost> (raw)
In-Reply-To: <878rcd2by5.fsf@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4805 bytes --]

On Wed, Jun 21, 2023 at 04:15:46PM +0300, Jani Nikula wrote:
> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> > On Wed, Jun 21, 2023 at 02:16:55PM +0300, Jani Nikula wrote:
> >> On Wed, 21 Jun 2023, Joel Granados <j.granados@samsung.com> wrote:
> >> > Remove the empty end element from all the arrays that are passed to the
> >> > register sysctl calls. In some files this means reducing the explicit
> >> > array size by one. Also make sure that we are using the size in
> >> > ctl_table_header instead of evaluating the .procname element.
> >> 
> >> Where's the harm in removing the end elements driver by driver? This is
> >> an unwieldy patch to handle.
> >
> > I totally agree. Its a big one!!! but I'm concerned of breaking bisectibility:
> > * I could for example separate all the removes into separate commits and
> >   then have a final commit that removes the check for the empty element.
> >   But this will leave the tree in a state where the for loop will have
> >   undefined behavior when it looks for the empty end element. It might
> >   or might not work (probably not :) until the final commit where I fix
> >   that.
> >
> > * I could also change the logic that looks for the final element,
> >   commit that first and then remove the empty element one commit per
> >   driver after that. But then for all the arrays that still have an
> >   empty element, there would again be undefined behavior as it would
> >   think that the last element is valid (when it is really the sentinel).
> >
> > Any ideas on how to get around these?
> 
> First add size to the register calls, and allow the last one to be
> sentinel but do not require the sentinel.
> 
> Start removing sentinels, adjusting the size passed in.
This is a great idea! and I think I don't even have to adjust the size
because if I change the logic to stop on the sentinel or the size; so when
the sentinel is there, it will stop before the size. And when the
sentinel is not there, it will stop on the correct size.

There might be issues with indirection calls. And there might also be
lots of places where I need to adjust a for loop (as dan has pointed
out) but its worth a try for V2.

Best
> 
> Once enough sentinels have been removed, add warning if the final entry
> is a sentinel.
> 
> Never really remove the check? (But surely you can rework the logic to
> not count the number of elements up front, only while iterating.)
> 
> 
> BR,
> Jani.
> 
> >> 
> >> > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> >> > index f43950219ffc..e4d7372afb10 100644
> >> > --- a/drivers/gpu/drm/i915/i915_perf.c
> >> > +++ b/drivers/gpu/drm/i915/i915_perf.c
> >> > @@ -4884,24 +4884,23 @@ int i915_perf_remove_config_ioctl(struct drm_device *dev, void *data,
> >> >  
> >> >  static struct ctl_table oa_table[] = {
> >> >  	{
> >> > -	 .procname = "perf_stream_paranoid",
> >> > -	 .data = &i915_perf_stream_paranoid,
> >> > -	 .maxlen = sizeof(i915_perf_stream_paranoid),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = SYSCTL_ONE,
> >> > -	 },
> >> > +		.procname = "perf_stream_paranoid",
> >> > +		.data = &i915_perf_stream_paranoid,
> >> > +		.maxlen = sizeof(i915_perf_stream_paranoid),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = SYSCTL_ONE,
> >> > +	},
> >> >  	{
> >> > -	 .procname = "oa_max_sample_rate",
> >> > -	 .data = &i915_oa_max_sample_rate,
> >> > -	 .maxlen = sizeof(i915_oa_max_sample_rate),
> >> > -	 .mode = 0644,
> >> > -	 .proc_handler = proc_dointvec_minmax,
> >> > -	 .extra1 = SYSCTL_ZERO,
> >> > -	 .extra2 = &oa_sample_rate_hard_limit,
> >> > -	 },
> >> > -	{}
> >> > +		.procname = "oa_max_sample_rate",
> >> > +		.data = &i915_oa_max_sample_rate,
> >> > +		.maxlen = sizeof(i915_oa_max_sample_rate),
> >> > +		.mode = 0644,
> >> > +		.proc_handler = proc_dointvec_minmax,
> >> > +		.extra1 = SYSCTL_ZERO,
> >> > +		.extra2 = &oa_sample_rate_hard_limit,
> >> > +	}
> >> >  };
> >> 
> >> The existing indentation is off, but fixing it doesn't really belong in
> >> this patch.
> >
> > Agreed. But I actually was trying to fix something that checkpatch
> > flagged. I'll change these back (which will cause this patch to be
> > flagged).
> >
> > An alternative solution would be to fix the indentation as part of the
> > preparation patches. Tell me what you think.
> >
> > Thx
> >
> >> 
> >> BR,
> >> Jani.
> >> 
> >> 
> >> -- 
> >> Jani Nikula, Intel Open Source Graphics Center
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2023-06-21 13:43 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230621091002eucas1p28cbe3260b7d4c2a086f0b5ac79a7f038@eucas1p2.samsung.com>
2023-06-21  9:09 ` [PATCH 00/11] Remove the end element in sysctl table arrays Joel Granados
     [not found]   ` <CGME20230621091004eucas1p2e53ad3001cdaef7b3c44555653bbec37@eucas1p2.samsung.com>
2023-06-21  9:09     ` [PATCH 01/11] sysctl: Prefer ctl_table_header in proc_sysctl Joel Granados
     [not found]   ` <CGME20230621091007eucas1p2271595a5889075994e8dceb0c06ae7cc@eucas1p2.samsung.com>
2023-06-21  9:09     ` [PATCH 02/11] sysctl: Use the ctl header in list ctl_table macro Joel Granados
     [not found]   ` <CGME20230621091009eucas1p1e4fa56beb44e49e4d1160bfac6eb59ec@eucas1p1.samsung.com>
2023-06-21  9:09     ` [PATCH 03/11] sysctl: Add ctl_table_size to ctl_table_header Joel Granados
     [not found]   ` <CGME20230621091011eucas1p2116c1fb8f406bec7ca9a831f66955724@eucas1p2.samsung.com>
2023-06-21  9:09     ` [PATCH 04/11] sysctl: Add size argument to init_header Joel Granados
     [not found]   ` <CGME20230621091014eucas1p1a30430568d0f7fec5ccbed31cab73aa0@eucas1p1.samsung.com>
2023-06-21  9:09     ` [PATCH 05/11] sysctl: Add a size arg to __register_sysctl_table Joel Granados
2023-06-21 20:53       ` Jakub Kicinski
2023-06-22 14:09         ` Joel Granados
     [not found]   ` <CGME20230621091022eucas1p1c097da50842b23e902e1a674e117e1aa@eucas1p1.samsung.com>
2023-06-21  9:09     ` [PATCH 06/11] sysctl: Add size to register_net_sysctl function Joel Granados
2023-06-21  9:09       ` [Bridge] " Joel Granados
2023-06-21  9:09       ` Joel Granados
2023-06-21  9:09       ` Joel Granados
2023-06-21  9:47       ` Dan Carpenter
2023-06-21  9:47         ` [Bridge] " Dan Carpenter
2023-06-21  9:47         ` Dan Carpenter
2023-06-21  9:47         ` Dan Carpenter
2023-06-21 10:23         ` Dan Carpenter
2023-06-21 10:23           ` [Bridge] " Dan Carpenter
2023-06-21 10:23           ` Dan Carpenter
2023-06-21 10:23           ` Dan Carpenter
2023-06-21 12:03           ` Joel Granados
2023-06-21 12:03             ` [Bridge] " Joel Granados
2023-06-21 12:03             ` Joel Granados
2023-06-21 12:03             ` Joel Granados
2023-06-23 14:21           ` Joel Granados
2023-06-23 14:21             ` [Bridge] " Joel Granados
2023-06-23 14:21             ` Joel Granados
2023-06-23 14:21             ` Joel Granados
2023-06-21 10:49         ` Dan Carpenter
2023-06-21 10:49           ` [Bridge] " Dan Carpenter
2023-06-21 10:49           ` Dan Carpenter
2023-06-21 10:49           ` Dan Carpenter
2023-06-21 11:49           ` Joel Granados
2023-06-21 11:49             ` [Bridge] " Joel Granados
2023-06-21 11:49             ` Joel Granados
2023-06-21 11:49             ` Joel Granados
2023-06-21 11:36         ` Joel Granados
2023-06-21 11:36           ` [Bridge] " Joel Granados
2023-06-21 11:36           ` Joel Granados
2023-06-21 11:36           ` Joel Granados
     [not found]   ` <CGME20230621091029eucas1p2f9fd694dae3dfbdfffd25dccf4fcb568@eucas1p2.samsung.com>
2023-06-21  9:09     ` [PATCH 07/11] sysctl: Add size to register_sysctl Joel Granados
2023-06-21  9:09       ` [Intel-gfx] " Joel Granados
2023-06-21  9:09       ` Joel Granados
2023-06-21  9:09       ` Joel Granados
2023-06-21  9:09       ` [Ocfs2-devel] " Joel Granados via Ocfs2-devel
     [not found]   ` <CGME20230621091037eucas1p188e11d8064526a5a0549217d5a419647@eucas1p1.samsung.com>
2023-06-21  9:09     ` [PATCH 08/11] sysctl: Add size to register_sysctl_init Joel Granados
2023-06-21  9:09       ` Joel Granados
2023-06-21  9:56       ` Jiri Slaby
2023-06-21  9:56         ` Jiri Slaby
2023-06-21 13:11         ` Joel Granados
2023-06-21 13:11           ` Joel Granados
2023-06-22  4:25           ` Jiri Slaby
2023-06-22  4:25             ` Jiri Slaby
2023-06-22 13:59             ` Joel Granados
2023-06-22 13:59               ` Joel Granados
2023-06-21 10:47       ` Greg Kroah-Hartman
2023-06-21 10:47         ` Greg Kroah-Hartman
2023-06-21 13:15         ` Joel Granados
2023-06-21 13:15           ` Joel Granados
2023-06-22  4:21           ` Jiri Slaby
2023-06-22  4:21             ` Jiri Slaby
2023-06-22 14:00             ` Joel Granados
2023-06-22 14:00               ` Joel Granados
2023-06-23 15:20               ` Petr Mladek
2023-06-23 15:20                 ` Petr Mladek
2023-06-21 11:36       ` Petr Mladek
2023-06-21 11:36         ` Petr Mladek
2023-06-21 15:30         ` Joel Granados
2023-06-21 15:30           ` Joel Granados
     [not found]   ` <CGME20230621094824eucas1p154c97eead5f2de6bceca6359304b775c@eucas1p1.samsung.com>
2023-06-21  9:48     ` [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays Joel Granados
2023-06-21  9:48       ` [Bridge] " Joel Granados
2023-06-21  9:48       ` Joel Granados
2023-06-21  9:48       ` Joel Granados
2023-06-21  9:48       ` [Intel-gfx] " Joel Granados
2023-06-21  9:48       ` Joel Granados
2023-06-21  9:48       ` Joel Granados
2023-06-21  9:48       ` [Ocfs2-devel] " Joel Granados via Ocfs2-devel
2023-06-21  9:48       ` Joel Granados
     [not found]       ` <CGME20230621094825eucas1p2d37372e5bd2377bfe953e6e4f7ff0363@eucas1p2.samsung.com>
2023-06-21  9:48         ` [PATCH 10/11] sysctl: Remove nr_entries from new_links Joel Granados
     [not found]       ` <CGME20230621094828eucas1p22b0b45adc25f881fe00a20d96d495d95@eucas1p2.samsung.com>
2023-06-21  9:48         ` [PATCH 11/11] sysctl: rm "child" from __register_sysctl_table doc Joel Granados
2023-06-21 11:16       ` [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays Jani Nikula
2023-06-21 11:16         ` [Bridge] " Jani Nikula
2023-06-21 11:16         ` Jani Nikula
2023-06-21 11:16         ` Jani Nikula
2023-06-21 11:16         ` [Intel-gfx] " Jani Nikula
2023-06-21 11:16         ` Jani Nikula
2023-06-21 11:16         ` Jani Nikula
2023-06-21 11:16         ` [Ocfs2-devel] " Jani Nikula via Ocfs2-devel
2023-06-21 13:06         ` Joel Granados
2023-06-21 13:06           ` [Bridge] " Joel Granados
2023-06-21 13:06           ` Joel Granados
2023-06-21 13:06           ` [Intel-gfx] " Joel Granados
2023-06-21 13:06           ` Joel Granados
2023-06-21 13:06           ` Joel Granados
2023-06-21 13:06           ` [Ocfs2-devel] " Joel Granados via Ocfs2-devel
2023-06-21 13:15           ` Jani Nikula
2023-06-21 13:15             ` [Bridge] " Jani Nikula
2023-06-21 13:15             ` Jani Nikula
2023-06-21 13:15             ` [Intel-gfx] " Jani Nikula
2023-06-21 13:15             ` Jani Nikula
2023-06-21 13:15             ` Jani Nikula
2023-06-21 13:15             ` [Ocfs2-devel] " Jani Nikula via Ocfs2-devel
2023-06-21 13:43             ` Joel Granados [this message]
2023-06-21 13:43               ` [Bridge] " Joel Granados
2023-06-21 13:43               ` Joel Granados
2023-06-21 13:43               ` [Intel-gfx] " Joel Granados
2023-06-21 13:43               ` Joel Granados
2023-06-21 13:43               ` Joel Granados
2023-06-21 13:43               ` [Ocfs2-devel] " Joel Granados via Ocfs2-devel
2023-06-21 10:46   ` [PATCH 00/11] " Greg KH
2023-06-21 12:38     ` Joel Granados
2023-06-21 13:10       ` Greg KH
2023-06-21 14:13         ` Joel Granados

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621134348.rcdzl7fi7yq2uj6h@localhost \
    --to=j.granados@samsung.com \
    --cc=Jason@zx2c4.com \
    --cc=agordeev@linux.ibm.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.aring@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=andrii@kernel.org \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=anna@kernel.org \
    --cc=anton@tuxera.com \
    --cc=apparmor@lists.ubuntu.com \
    --cc=arnd@arndb.de \
    --cc=ast@kernel.org \
    --cc=bcrl@kvack.org \
    --cc=benh@kernel.crashing.org \
    --cc=boqun.feng@gmail.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=bsingharora@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=chuck.lever@oracle.com \
    --cc=clemens@ladisch.de \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@telemann.coda.cs.cmu.edu \
    --cc=coreteam@netfilter.org \
    --cc=courmisch@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dccp@vger.kernel.org \
    --cc=decui@microsoft.com \
    --cc=dgilbert@interlog.com \
    --cc=dhowells@redhat.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=djwong@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dsahern@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=ebiggers@kernel.org \
    --cc=edumazet@google.com \
    --cc=fsverity@lists.linux.dev \
    --cc=fw@strlen.de \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=haoluo@google.com \
    --cc=hca@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@verge.net.au \
    --cc=hpa@zytor.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ja@ssi.bg \
    --cc=jack@suse.cz \
    --cc=jaharkes@cs.cmu.edu \
    --cc=jaka@linux.ibm.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=jarkko@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=jgross@suse.com \
    --cc=jirislaby@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=jlbec@evilplan.org \
    --cc=jmaloy@redhat.com \
    --cc=jmorris@namei.org \
    --cc=john.fastabend@gmail.com \
    --cc=john.johansen@canonical.com \
    --cc=john.ogness@linutronix.de \
    --cc=jolsa@kernel.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=jreuter@yaina.de \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kadlec@netfilter.org \
    --cc=keescook@chromium.org \
    --cc=kexec@lists.infradead.org \
    --cc=keyrings@vger.kernel.org \
    --cc=kgraul@linux.ibm.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=linux-x25@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=longman@redhat.com \
    --cc=lucien.xin@gmail.com \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=mark@fasheh.com \
    --cc=martin.lau@linux.dev \
    --cc=martin.petersen@oracle.com \
    --cc=martineau@kernel.org \
    --cc=matthieu.baerts@tessares.net \
    --cc=mcgrof@kernel.org \
    --cc=mgorman@suse.de \
    --cc=mhiramat@kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=mike.travis@hpe.com \
    --cc=mingo@redhat.com \
    --cc=minyard@acm.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mpe@ellerman.id.au \
    --cc=mptcp@lists.linux.dev \
    --cc=ms@dev.tdt.de \
    --cc=muchun.song@linux.dev \
    --cc=naoya.horiguchi@nec.com \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=npiggin@gmail.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=paul@paul-moore.com \
    --cc=peterz@infradead.org \
    --cc=phil@philpotter.co.uk \
    --cc=pmladek@suse.com \
    --cc=rafael@kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=razor@blackwall.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=repnop@google.com \
    --cc=robinmholt@gmail.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=roopa@nvidia.com \
    --cc=rostedt@goodmis.org \
    --cc=russell.h.weight@intel.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=sboyd@kernel.org \
    --cc=sdf@google.com \
    --cc=senozhatsky@chromium.org \
    --cc=serge@hallyn.com \
    --cc=song@kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=stefan@datenfreihafen.org \
    --cc=steffen.klassert@secunet.com \
    --cc=steve.wahl@hpe.com \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=trond.myklebust@hammerspace.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=tytso@mit.edu \
    --cc=vincent.guittot@linaro.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=vschneid@redhat.com \
    --cc=wad@chromium.org \
    --cc=wei.liu@kernel.org \
    --cc=wenjia@linux.ibm.com \
    --cc=will@kernel.org \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yhs@fb.com \
    --cc=ying.xue@windriver.com \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.