Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2726599pxb; Mon, 25 Apr 2022 00:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmj3dpmC+Appf7UOvGssT4ih8rB/aOlZE4sWr2AWoUclDtscFd0tJgoWrvaGzJI5lwpHO6 X-Received: by 2002:a17:907:7f02:b0:6ef:cc09:3d68 with SMTP id qf2-20020a1709077f0200b006efcc093d68mr15605751ejc.616.1650872219955; Mon, 25 Apr 2022 00:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650872219; cv=none; d=google.com; s=arc-20160816; b=VHXyHLD8YyGN0B3Fpispl8YXbjt90hSXTuPJSojnMODBwz+en+2S20UhtevfO+RzLR wIw4zMxlqy5sY3z/EveYZyCFgXes8eGDCieRhS+fJpmqW+KnQYy05UkWocf5ijNQV9v1 +evkJsQbTpRplyhL0FXSBm1cFysaq3hcxyOvQR1Gk4D2OT0q10sIHso/yly+TuIJLLHH 62ewQ0RhAH3YRPt4eWax5Qc0QKvVmwE+lZbnNtNiJvJcIL0Mj/uxbAGT41oli32MKgBc oif4LskDcx17eF+JNcvhTyerrut0O5wPfq1b7L+ADW9gQ17kXPMvXDU6zOO/213snoeU jIiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yWGAvjQef7xMOnO4TUloUSDXWdlreZxNm5RKmGNAwQs=; b=MSK3I9+U6s9HqMcqxAP+S10BYCmTRW+pNRqfTayby18DYQ5EQOrW8J9jrioFDccN4y gTjoVMJmAUKD/52OdrILb3q6Tmv4td8Kj1moEvaCT6yiF1/wFt8NtyHiCRWSTXfkCrBI 4NDvHexEDGTEZeoOxiTug1dLwp6i9VZfsr7+5eoeZH74BTBA6KZ8di6EJE+3O6Ml1iFs YhiFQx9vyplujzaYl+wE83Egb6tPIZVPMG/bx94okRmg4S4M7ROsAa2bN9CRmeLNQ8nU 48D5eYO6pZF+i2WsvyYFVsybopBjQaFtN8zUww4WJs69gkQvE/hTR/aLxsnWkeucKSjo zSHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G+dl9n0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m5-20020a509985000000b00423e4d00368si12037940edb.176.2022.04.25.00.36.36; Mon, 25 Apr 2022 00:36:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G+dl9n0f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240148AbiDYBbQ (ORCPT + 99 others); Sun, 24 Apr 2022 21:31:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240145AbiDYBbO (ORCPT ); Sun, 24 Apr 2022 21:31:14 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8BBDEDE935 for ; Sun, 24 Apr 2022 18:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650850090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yWGAvjQef7xMOnO4TUloUSDXWdlreZxNm5RKmGNAwQs=; b=G+dl9n0fvE10riqusbhyaIT0WHDuziAbxZVeDxmlMHclSdNxGJB6vU6904Mx74CKo1RVrW 58hSl/3BttQd5GXwpOS3SdtsRFKPM0cCQxO7iBCXXxwlEM5637DlUoTnV3DDW38ngpl9xJ ZV54q89Li4cuQcJR7bQ3zG9rWPrM2/A= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-1-HvICT7MBPIa_1yJKboZq2Q-1; Sun, 24 Apr 2022 21:28:07 -0400 X-MC-Unique: HvICT7MBPIa_1yJKboZq2Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6A5AD1C0514D; Mon, 25 Apr 2022 01:28:06 +0000 (UTC) Received: from localhost (ovpn-12-73.pek2.redhat.com [10.72.12.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFC6B40EC001; Mon, 25 Apr 2022 01:28:04 +0000 (UTC) Date: Mon, 25 Apr 2022 09:28:01 +0800 From: Baoquan He To: yingelin Cc: ebiederm@xmission.com, keescook@chromium.org, mcgrof@kernel.org, yzaikin@google.com, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, chenjianguo3@huawei.com, nixiaoming@huawei.com, qiuguorui1@huawei.com, young.liuyang@huawei.com, zengweilin@huawei.com Subject: Re: [PATCH sysctl-testing v2] kernel/kexec_core: move kexec_core sysctls into its own file Message-ID: References: <20220424025740.50371-1-yingelin@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220424025740.50371-1-yingelin@huawei.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/24/22 at 10:57am, yingelin wrote: > This move the kernel/kexec_core.c respective sysctls to its own file. > > kernel/sysctl.c has grown to an insane mess, We move sysctls to places > where features actually belong to improve the readability and reduce > merge conflicts. At the same time, the proc-sysctl maintainers can easily > care about the core logic other than the sysctl knobs added for some feature. > > We already moved all filesystem sysctls out. This patch is part of the effort > to move kexec related sysctls out. > > Signed-off-by: yingelin LGTM, Acked-by: Baoquan He > > --- > v2: > 1. Add the explanation to commit log to help patch review and subsystem > maintainers better understand the context/logic behind the migration > 2. Add CONFIG_SYSCTL to to isolate the sysctl > 3. Change subject-prefix of sysctl-next to sysctl-testing > > v1: https://lore.kernel.org/lkml/20220223030318.213093-1-yingelin@huawei.com/ > 1. Lack more informations in the commit log to help patch review better > 2. Lack isolation of the sysctl > 3. Use subject-prefix of sysctl-next > --- > kernel/kexec_core.c | 22 ++++++++++++++++++++++ > kernel/sysctl.c | 13 ------------- > 2 files changed, 22 insertions(+), 13 deletions(-) > > diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c > index 68480f731192..a0456baf52cc 100644 > --- a/kernel/kexec_core.c > +++ b/kernel/kexec_core.c > @@ -936,6 +936,28 @@ int kimage_load_segment(struct kimage *image, > struct kimage *kexec_image; > struct kimage *kexec_crash_image; > int kexec_load_disabled; > +#ifdef CONFIG_SYSCTL > +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); > +#endif > > /* > * No panic_cpu check version of crash_kexec(). This function is called > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index b60345cbadf0..0f3cb61a2e39 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -61,7 +61,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -1712,18 +1711,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 > > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec >