Received: by 2002:ac2:5a04:0:0:0:0:0 with SMTP id q4csp1080463lfn; Wed, 23 Feb 2022 18:35:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+VsLkHIeAAFcqDh2nVIjzH9XscAWB0O4qdqn+QuoBwZ69sWguGcDJGu9UKuYM98a9LC/X X-Received: by 2002:a17:902:cecf:b0:149:4c30:6dd2 with SMTP id d15-20020a170902cecf00b001494c306dd2mr740754plg.93.1645670142031; Wed, 23 Feb 2022 18:35:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645670142; cv=none; d=google.com; s=arc-20160816; b=fh0swpO7gLxKQkzQvkUVpBPgiRvyZn8Yk76HHFzSwpAbmkJ5PjiU5nOb1eNZQRYyLc bKeb0XnqnJ2sf6W87Z/xXtk3PxA2cCcz1aSV1eMMtsnGpUqqdnKKWj85qxZ5tZ9Hn/Bm Ix8m3SYV/Oev4rbQzCEJzsI+0QbpS6+10sOtL2mWjf8UaUg6l532/OEV4yKt1nIOQmQY DktNLbAboXzSrCKkxmR9RIKezHM0IOAKYP7DHqhl52A+HeMie9nBgs0Q3DFbNKIQbGiQ mY2YH1hXLjUDAWAo1X/JPcb2IV2ecp5QFCOe392Mw68lVr4GVKjhA/R0kW8nDnKHMKXX QgHw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Mosce6mCx+3FrNUgxT+llyIw3dAjkfUdqQ0Qnjl3teY=; b=dueLyzxiGu4oB5mEPu/cT8kY14XzIb3Qnmfp0XCDwCFjW46IWIKoQPOCCwO4XgXQQl HsjtDvF+un2bQpnzlXEWZU/aT0Fh5fvgcMdrB5WOsfHio6OSGRNGBh+RFxnWFr0SIrb4 lTcE9Zxjy6R0nE4h8L+jRNcbtlZdUThiBGSWAwxCL5YkBX3NkA4YaS1DNYXo1AGmEQuV 5Fl9gFHzE4bU0beTvdcmFw8TOX/TIsAVn6fyPChE/k61dNQZqOLsW04Uw1YJoCeg+N5l zh0CT1ijnXPklbtIRik4BjNWFLkjXCrypMudEHG0xxb4+VkkITLBFgUCSXZpmCRVaRkx qGYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="G7m/WzI6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n17si1293784plg.613.2022.02.23.18.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 18:35:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="G7m/WzI6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC72D233E56; Wed, 23 Feb 2022 18:35:39 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiBXCgD (ORCPT + 99 others); Wed, 23 Feb 2022 21:36:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbiBXCgC (ORCPT ); Wed, 23 Feb 2022 21:36:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0116B2325F3 for ; Wed, 23 Feb 2022 18:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645670132; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mosce6mCx+3FrNUgxT+llyIw3dAjkfUdqQ0Qnjl3teY=; b=G7m/WzI67WpIMMTks74/1MVWA6iMyEI3XlIfunIL2wPuBJ7pwBOtZUGlInpNlmX7GB19KI bjsNT9QC1MsGhNAMj+m0bZoWl/FD5Meypfw2Fqa66DYQsjkwXMplmzkgToO+o+W3wu06M0 8ugKqeMa9Y4ic4QY4+CNuoCjcBcWI1A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-344-5VULfEcfP2aqeaJ0LvbtoQ-1; Wed, 23 Feb 2022 21:35:28 -0500 X-MC-Unique: 5VULfEcfP2aqeaJ0LvbtoQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A31A2180FD71; Thu, 24 Feb 2022 02:35:26 +0000 (UTC) Received: from localhost (ovpn-13-249.pek2.redhat.com [10.72.13.249]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBEEF4BC68; Thu, 24 Feb 2022 02:35:24 +0000 (UTC) Date: Thu, 24 Feb 2022 10:35:21 +0800 From: Baoquan He To: yingelin 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 Message-ID: References: <20220223030318.213093-1-yingelin@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 02/24/22 at 09:04am, yingelin wrote: > > 在 2022/2/23 16:30, Baoquan He 写道: > > 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? > > kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, > > this makes it very difficult to maintain. The proc sysctl maintainers do not > want to > > know what sysctl knobs you wish to add for your own piece of code, we > > just care about the core logic. > > This patch moves the kexec sysctls to the place where they actually belong > to help That seems to be an issue everything related to sysctl are all added to kernel/sysctl.c. Do you have a pointer that someone complained about it and people agree to scatter them into their own component code? I understand your concern now, I am personally not confused by that maybe because I haven't got stuff adding or changing into sysctls. My concern is if we only care and move kexec knob, or we have plan to try to move all of them. If there's some background information or discussion with a link, that would be helpful. Thanks Baoquan > > with this maintenance. > > > > Signed-off-by: yingelin > > > --- > > > 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 > > > #include > > > #include > > > -#include > > > #include > > > #include > > > #include > > > @@ -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 > > > > > . >