From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>, <tony.luck@intel.com>, <bp@alien8.de>
Cc: <nao.horiguchi@gmail.com>, <linmiaohe@huawei.com>,
<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<linux-edac@vger.kernel.org>
Subject: [PATCH v3 10/13] mm/memory-failure: move some function declarations into internal.h
Date: Wed, 12 Jun 2024 15:18:32 +0800 [thread overview]
Message-ID: <20240612071835.157004-11-linmiaohe@huawei.com> (raw)
In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com>
There are some functions only used inside mm. Move them into internal.h.
No functional change intended.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405251049.hxjwX7zO-lkp@intel.com/
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
include/linux/mm.h | 7 -------
include/linux/page-flags.h | 5 -----
include/linux/rmap.h | 2 --
mm/internal.h | 10 ++++++++++
4 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0bf0f22b32c8..587d34879865 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -3981,7 +3981,6 @@ extern int __get_huge_page_for_hwpoison(unsigned long pfn, int flags,
bool *migratable_cleared);
void num_poisoned_pages_inc(unsigned long pfn);
void num_poisoned_pages_sub(unsigned long pfn, long i);
-struct task_struct *task_early_kill(struct task_struct *tsk, int force_early);
#else
static inline void memory_failure_queue(unsigned long pfn, int flags)
{
@@ -4002,12 +4001,6 @@ static inline void num_poisoned_pages_sub(unsigned long pfn, long i)
}
#endif
-#if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_KSM)
-void add_to_kill_ksm(struct task_struct *tsk, struct page *p,
- struct vm_area_struct *vma, struct list_head *to_kill,
- unsigned long ksm_addr);
-#endif
-
#if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_MEMORY_HOTPLUG)
extern void memblk_nr_poison_inc(unsigned long pfn);
extern void memblk_nr_poison_sub(unsigned long pfn, long i);
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 0c9fd5250687..9a98b657ba07 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -611,11 +611,6 @@ PAGEFLAG_FALSE(Uncached, uncached)
PAGEFLAG(HWPoison, hwpoison, PF_ANY)
TESTSCFLAG(HWPoison, hwpoison, PF_ANY)
#define __PG_HWPOISON (1UL << PG_hwpoison)
-#define MAGIC_HWPOISON 0x48575053U /* HWPS */
-extern void SetPageHWPoisonTakenOff(struct page *page);
-extern void ClearPageHWPoisonTakenOff(struct page *page);
-extern bool take_page_off_buddy(struct page *page);
-extern bool put_page_back_buddy(struct page *page);
#else
PAGEFLAG_FALSE(HWPoison, hwpoison)
#define __PG_HWPOISON 0
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index cae38a2a643d..b1bbe237ea4c 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -745,8 +745,6 @@ int pfn_mkclean_range(unsigned long pfn, unsigned long nr_pages, pgoff_t pgoff,
void remove_migration_ptes(struct folio *src, struct folio *dst, bool locked);
-unsigned long page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
-
/*
* rmap_walk_control: To control rmap traversing for specific needs
*
diff --git a/mm/internal.h b/mm/internal.h
index 14bab8a41baf..c9dc056a47a3 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1078,6 +1078,16 @@ extern u64 hwpoison_filter_flags_mask;
extern u64 hwpoison_filter_flags_value;
extern u64 hwpoison_filter_memcg;
extern u32 hwpoison_filter_enable;
+#define MAGIC_HWPOISON 0x48575053U /* HWPS */
+void SetPageHWPoisonTakenOff(struct page *page);
+void ClearPageHWPoisonTakenOff(struct page *page);
+bool take_page_off_buddy(struct page *page);
+bool put_page_back_buddy(struct page *page);
+struct task_struct *task_early_kill(struct task_struct *tsk, int force_early);
+void add_to_kill_ksm(struct task_struct *tsk, struct page *p,
+ struct vm_area_struct *vma, struct list_head *to_kill,
+ unsigned long ksm_addr);
+unsigned long page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long,
unsigned long, unsigned long,
--
2.33.0
next prev parent reply other threads:[~2024-06-12 7:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 7:18 [PATCH v3 00/13] Some cleanups for memory-failure Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 01/13] mm/memory-failure: simplify put_ref_page() Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 02/13] mm/memory-failure: remove MF_MSG_SLAB Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 03/13] mm/memory-failure: add macro GET_PAGE_MAX_RETRY_NUM Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 04/13] mm/memory-failure: save some page_folio() calls Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 05/13] mm/memory-failure: remove unneeded empty string Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 06/13] mm/memory-failure: remove confusing initialization to count Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 07/13] mm/memory-failure: don't export hwpoison_filter() when !CONFIG_HWPOISON_INJECT Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 08/13] mm/memory-failure: use helper macro task_pid_nr() Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 09/13] mm/memory-failure: remove obsolete comment in unpoison_memory() Miaohe Lin
2024-06-12 7:18 ` Miaohe Lin [this message]
2024-06-12 7:18 ` [PATCH v3 11/13] mm/memory-failure: fix comment of get_hwpoison_page() Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 12/13] mm/memory-failure: remove obsolete comment in kill_proc() Miaohe Lin
2024-06-12 7:18 ` [PATCH v3 13/13] mm/memory-failure: correct comment in me_swapcache_dirty Miaohe Lin
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=20240612071835.157004-11-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nao.horiguchi@gmail.com \
--cc=tony.luck@intel.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