diff mbox series

[v2,10/13] mm/memory-failure: move some function declarations into internal.h

Message ID 20240606063247.712575-11-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series Some cleanups for memory-failure | expand

Commit Message

Miaohe Lin June 6, 2024, 6:32 a.m. UTC
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(-)

Comments

Matthew Wilcox June 7, 2024, 3:47 a.m. UTC | #1
On Thu, Jun 06, 2024 at 02:32:44PM +0800, Miaohe Lin wrote:
> +++ b/mm/internal.h
> @@ -1077,6 +1077,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 */
> +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);

s/extern// for function declarations.
Miaohe Lin June 7, 2024, 7 a.m. UTC | #2
On 2024/6/7 11:47, Matthew Wilcox wrote:
> On Thu, Jun 06, 2024 at 02:32:44PM +0800, Miaohe Lin wrote:
>> +++ b/mm/internal.h
>> @@ -1077,6 +1077,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 */
>> +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);
> 
> s/extern// for function declarations.

Will do in next version.
Thanks.
.
diff mbox series

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index ec7141fb0252..5ca79aff5e39 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4011,7 +4011,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)
 {
@@ -4032,12 +4031,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 f04fea86324d..b4e3444f1d9b 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -616,11 +616,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 0fd9bebce54c..8ff042c3eae2 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -723,8 +723,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 12e95fdf61e9..7b1368d14e85 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1077,6 +1077,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 */
+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);
+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,