linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: yingelin <yingelin@huawei.com>
Cc: ebiederm@xmission.com, mcgrof@kernel.org, keescook@chromium.org,
	yzaikin@google.com, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	zengweilin@huawei.com, chenjianguo3@huawei.com,
	nixiaoming@huawei.com, qiuguorui1@huawei.com,
	young.liuyang@huawei.com
Subject: Re: [PATCH sysctl-next] kernel/kexec_core: move kexec_core sysctls into its own file
Date: Wed, 23 Feb 2022 16:30:09 +0800	[thread overview]
Message-ID: <YhXwkTCwt3a4Dn9T@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20220223030318.213093-1-yingelin@huawei.com>

On 02/23/22 at 11:03am, yingelin wrote:
> This move the kernel/kexec_core.c respective sysctls to its own file.

Hmm, why is the move needed? 

With my understanding, sysctls are all put in kernel/sysctl.c,
why is kexec special?

> 
> Signed-off-by: yingelin <yingelin@huawei.com>
> ---
>  kernel/kexec_core.c | 20 ++++++++++++++++++++
>  kernel/sysctl.c     | 13 -------------
>  2 files changed, 20 insertions(+), 13 deletions(-)
> 
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 68480f731192..e57339d49439 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -936,6 +936,26 @@ int kimage_load_segment(struct kimage *image,
>  struct kimage *kexec_image;
>  struct kimage *kexec_crash_image;
>  int kexec_load_disabled;
> +static struct ctl_table kexec_core_sysctls[] = {
> +	{
> +		.procname	= "kexec_load_disabled",
> +		.data		= &kexec_load_disabled,
> +		.maxlen		= sizeof(int),
> +		.mode		= 0644,
> +		/* only handle a transition from default "0" to "1" */
> +		.proc_handler	= proc_dointvec_minmax,
> +		.extra1		= SYSCTL_ONE,
> +		.extra2		= SYSCTL_ONE,
> +	},
> +	{ }
> +};
> +
> +static int __init kexec_core_sysctl_init(void)
> +{
> +	register_sysctl_init("kernel", kexec_core_sysctls);
> +	return 0;
> +}
> +late_initcall(kexec_core_sysctl_init);
>  
>  /*
>   * No panic_cpu check version of crash_kexec().  This function is called
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index ae5e59396b5d..00e97c6d6576 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -61,7 +61,6 @@
>  #include <linux/capability.h>
>  #include <linux/binfmts.h>
>  #include <linux/sched/sysctl.h>
> -#include <linux/kexec.h>
>  #include <linux/bpf.h>
>  #include <linux/mount.h>
>  #include <linux/userfaultfd_k.h>
> @@ -1839,18 +1838,6 @@ static struct ctl_table kern_table[] = {
>  		.proc_handler	= tracepoint_printk_sysctl,
>  	},
>  #endif
> -#ifdef CONFIG_KEXEC_CORE
> -	{
> -		.procname	= "kexec_load_disabled",
> -		.data		= &kexec_load_disabled,
> -		.maxlen		= sizeof(int),
> -		.mode		= 0644,
> -		/* only handle a transition from default "0" to "1" */
> -		.proc_handler	= proc_dointvec_minmax,
> -		.extra1		= SYSCTL_ONE,
> -		.extra2		= SYSCTL_ONE,
> -	},
> -#endif
>  #ifdef CONFIG_MODULES
>  	{
>  		.procname	= "modprobe",
> -- 
> 2.26.2
> 


  reply	other threads:[~2022-02-23  8:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23  3:03 [PATCH sysctl-next] kernel/kexec_core: move kexec_core sysctls into its own file yingelin
2022-02-23  8:30 ` Baoquan He [this message]
2022-02-24  1:04   ` yingelin
2022-02-24  2:35     ` Baoquan He
2022-02-26 20:20       ` Luis Chamberlain
2022-02-28  1:43         ` yingelin
2022-02-28  3:18           ` Baoquan He
2022-04-15 22:59             ` Luis Chamberlain
2022-02-28  1:41       ` yingelin

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=YhXwkTCwt3a4Dn9T@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=chenjianguo3@huawei.com \
    --cc=ebiederm@xmission.com \
    --cc=keescook@chromium.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=nixiaoming@huawei.com \
    --cc=qiuguorui1@huawei.com \
    --cc=yingelin@huawei.com \
    --cc=young.liuyang@huawei.com \
    --cc=yzaikin@google.com \
    --cc=zengweilin@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).