linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] fs/drop_caches: move drop_caches sysctls into its own file
@ 2023-03-21 14:37 Alexey Dobriyan
  2023-03-21 16:42 ` Luis Chamberlain
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Dobriyan @ 2023-03-21 14:37 UTC (permalink / raw)
  To: brauner, frank.li
  Cc: mcgrof, Alexander Viro, Andrew Morton, Kees Cook, Iurii Zaikin,
	linux-fsdevel, linux-kernel, linux-mm

> > +static struct ctl_table drop_caches_table[] = {
> > +	{
> > +		.procname	= "drop_caches",
> > +		.data		= &sysctl_drop_caches,
> > +		.maxlen		= sizeof(int),
> > +		.mode		= 0200,
> > +		.proc_handler	= drop_caches_sysctl_handler,
> > +		.extra1		= SYSCTL_ONE,
> > +		.extra2		= SYSCTL_FOUR,
> > +	},
> > +	{}
> > +};
> > +
> > +static int __init drop_cache_init(void)
> > +{
> > +	register_sysctl_init("vm", drop_caches_table);
> 
> Does this belong under mm/ or fs/?
> And is it intended to be moved into a completely separate file?
> Feels abit wasteful for 20 lines of code...

It is better to keep all sysctls in one preallocated structure
for memory reasons:

	header = kzalloc(sizeof(struct ctl_table_header) +
                         sizeof(struct ctl_node)*nr_entries, GFP_KERNEL_ACCOUNT);


^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <20230321130908.6972-1-frank.li@vivo.com>]

end of thread, other threads:[~2023-03-21 18:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 14:37 [PATCH] fs/drop_caches: move drop_caches sysctls into its own file Alexey Dobriyan
2023-03-21 16:42 ` Luis Chamberlain
     [not found] <20230321130908.6972-1-frank.li@vivo.com>
2023-03-21 14:28 ` Christian Brauner
2023-03-21 16:39   ` Luis Chamberlain
2023-03-21 17:19     ` Christian Brauner
2023-03-21 16:42 ` Matthew Wilcox
2023-03-21 16:56   ` Luis Chamberlain
2023-03-21 17:19     ` Matthew Wilcox
2023-03-21 18:10       ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox