From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Naoya Horiguchi <naoya.horiguchi@nec.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: [PATCH 2/2] mm: memory-failure: move sysctl register in memory_failure_init()
Date: Mon, 8 May 2023 19:41:28 +0800 [thread overview]
Message-ID: <20230508114128.37081-2-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20230508114128.37081-1-wangkefeng.wang@huawei.com>
There is already a memory_failure_init(), don't add a new initcall,
move register_sysctl_init() into it to cleanup a bit.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
mm/memory-failure.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 5b663eca1f29..004a02f44271 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -123,7 +123,6 @@ const struct attribute_group memory_failure_attr_group = {
.attrs = memory_failure_attr,
};
-#ifdef CONFIG_SYSCTL
static struct ctl_table memory_failure_table[] = {
{
.procname = "memory_failure_early_kill",
@@ -146,14 +145,6 @@ static struct ctl_table memory_failure_table[] = {
{ }
};
-static int __init memory_failure_sysctl_init(void)
-{
- register_sysctl_init("vm", memory_failure_table);
- return 0;
-}
-late_initcall(memory_failure_sysctl_init);
-#endif /* CONFIG_SYSCTL */
-
/*
* Return values:
* 1: the page is dissolved (if needed) and taken off from buddy,
@@ -2441,6 +2432,8 @@ static int __init memory_failure_init(void)
INIT_WORK(&mf_cpu->work, memory_failure_work_func);
}
+ register_sysctl_init("vm", memory_failure_table);
+
return 0;
}
core_initcall(memory_failure_init);
--
2.35.3
next prev parent reply other threads:[~2023-05-08 11:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 11:41 [PATCH 1/2] mm: memory_failure: move memory_failure_attr_group under MEMORY_FAILURE Kefeng Wang
2023-05-08 11:41 ` Kefeng Wang [this message]
2023-05-10 3:06 ` [PATCH 2/2] mm: memory-failure: move sysctl register in memory_failure_init() HORIGUCHI NAOYA(堀口 直也)
2023-05-10 3:03 ` [PATCH 1/2] mm: memory_failure: move memory_failure_attr_group under MEMORY_FAILURE HORIGUCHI NAOYA(堀口 直也)
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=20230508114128.37081-2-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=naoya.horiguchi@nec.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