diff mbox series

[5/6] mm: memory-failure: use isolate_movable_folio() in mf_isolate_folio()

Message ID 20240327141034.3712697-6-wangkefeng.wang@huawei.com (mailing list archive)
State New
Headers show
Series mm: remove isolate_lru_page() and isolate_movable_page() | expand

Commit Message

Kefeng Wang March 27, 2024, 2:10 p.m. UTC
Directly use isolate_movable_folio() helper in mf_isolate_folio().

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 mm/memory-failure.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Zi Yan March 27, 2024, 3:12 p.m. UTC | #1
On 27 Mar 2024, at 10:10, Kefeng Wang wrote:

> Directly use isolate_movable_folio() helper in mf_isolate_folio().
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  mm/memory-failure.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
LGTM. Reviewed-by: Zi Yan <ziy@nvidia.com>

--
Best Regards,
Yan, Zi
kernel test robot March 28, 2024, 4:57 p.m. UTC | #2
Hi Kefeng,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.9-rc1]
[cannot apply to akpm-mm/mm-everything next-20240328]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kefeng-Wang/mm-migrate-add-isolate_movable_folio/20240327-221513
base:   linus/master
patch link:    https://lore.kernel.org/r/20240327141034.3712697-6-wangkefeng.wang%40huawei.com
patch subject: [PATCH 5/6] mm: memory-failure: use isolate_movable_folio() in mf_isolate_folio()
config: parisc-randconfig-r051-20240328 (https://download.01.org/0day-ci/archive/20240329/202403290000.hSRD3CAB-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240329/202403290000.hSRD3CAB-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403290000.hSRD3CAB-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/memory-failure.c: In function 'mf_isolate_folio':
>> mm/memory-failure.c:2631:58: error: passing argument 1 of 'isolate_movable_folio' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2631 |                         isolated = isolate_movable_folio(folio,
         |                                                          ^~~~~
         |                                                          |
         |                                                          struct folio *
   In file included from mm/memory-failure.c:51:
   include/linux/migrate.h:98:55: note: expected 'struct page *' but argument is of type 'struct folio *'
      98 | static inline bool isolate_movable_folio(struct page *page, isolate_mode_t mode)
         |                                          ~~~~~~~~~~~~~^~~~
   cc1: some warnings being treated as errors


vim +/isolate_movable_folio +2631 mm/memory-failure.c

  2618	
  2619	static bool mf_isolate_folio(struct folio *folio, struct list_head *pagelist)
  2620	{
  2621		bool isolated = false;
  2622	
  2623		if (folio_test_hugetlb(folio)) {
  2624			isolated = isolate_hugetlb(folio, pagelist);
  2625		} else {
  2626			bool lru = !__folio_test_movable(folio);
  2627	
  2628			if (lru)
  2629				isolated = folio_isolate_lru(folio);
  2630			else
> 2631				isolated = isolate_movable_folio(folio,
  2632								 ISOLATE_UNEVICTABLE);
  2633	
  2634			if (isolated) {
  2635				list_add(&folio->lru, pagelist);
  2636				if (lru)
  2637					node_stat_add_folio(folio, NR_ISOLATED_ANON +
  2638							    folio_is_file_lru(folio));
  2639			}
  2640		}
  2641	
  2642		/*
  2643		 * If we succeed to isolate the folio, we grabbed another refcount on
  2644		 * the folio, so we can safely drop the one we got from get_any_page().
  2645		 * If we failed to isolate the folio, it means that we cannot go further
  2646		 * and we will return an error, so drop the reference we got from
  2647		 * get_any_page() as well.
  2648		 */
  2649		folio_put(folio);
  2650		return isolated;
  2651	}
  2652
diff mbox series

Patch

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 9349948f1abf..6f47776df0e1 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2628,8 +2628,8 @@  static bool mf_isolate_folio(struct folio *folio, struct list_head *pagelist)
 		if (lru)
 			isolated = folio_isolate_lru(folio);
 		else
-			isolated = isolate_movable_page(&folio->page,
-							ISOLATE_UNEVICTABLE);
+			isolated = isolate_movable_folio(folio,
+							 ISOLATE_UNEVICTABLE);
 
 		if (isolated) {
 			list_add(&folio->lru, pagelist);