diff mbox series

[1/2] mm: move page_rmapping() and page_anon_vma() to mm/internal.h

Message ID 20210405151355.9867-2-rppt@kernel.org (mailing list archive)
State New, archived
Headers show
Series minor cleanups of include/linux/mm.h | expand

Commit Message

Mike Rapoport April 5, 2021, 3:13 p.m. UTC
From: Mike Rapoport <rppt@linux.ibm.com>

The functions page_rmapping() and page_anon_vma() are not used outside core
mm. Move their declaration from include/linux/mm.h to mm/internal.h

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 include/linux/mm.h | 2 --
 mm/internal.h      | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Matthew Wilcox April 5, 2021, 6:18 p.m. UTC | #1
On Mon, Apr 05, 2021 at 06:13:54PM +0300, Mike Rapoport wrote:
> From: Mike Rapoport <rppt@linux.ibm.com>
> 
> The functions page_rmapping() and page_anon_vma() are not used outside core
> mm. Move their declaration from include/linux/mm.h to mm/internal.h
> 
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>

This has purely textual conflicts with the folio series, but no conceptual
conflicts.  I generally approve of moving things out of mm.h, so

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
kernel test robot April 5, 2021, 8 p.m. UTC | #2
Hi Mike,

I love your patch! Yet something to improve:

[auto build test ERROR on hnaz-linux-mm/master]
[also build test ERROR on v5.12-rc6 next-20210401]
[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]

url:    https://github.com/0day-ci/linux/commits/Mike-Rapoport/minor-cleanups-of-include-linux-mm-h/20210405-231514
base:   https://github.com/hnaz/linux-mm master
config: x86_64-randconfig-a004-20210405 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 2760a808b9916a2839513b7fd7314a464f52481e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/c025240d41e9b6388c57fd4cde4a520074e41539
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mike-Rapoport/minor-cleanups-of-include-linux-mm-h/20210405-231514
        git checkout c025240d41e9b6388c57fd4cde4a520074e41539
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> mm/page_idle.c:105:7: error: implicit declaration of function 'page_rmapping' [-Werror,-Wimplicit-function-declaration]
               !page_rmapping(page))
                ^
   mm/page_idle.c:105:7: note: did you mean 'page_mapping'?
   include/linux/mm.h:1549:23: note: 'page_mapping' declared here
   struct address_space *page_mapping(struct page *page);
                         ^
   1 error generated.


vim +/page_rmapping +105 mm/page_idle.c

33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   91  
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   92  static void page_idle_clear_pte_refs(struct page *page)
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   93  {
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   94  	/*
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   95  	 * Since rwc.arg is unused, rwc is effectively immutable, so we
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   96  	 * can make it static const to save some cycles and stack.
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   97  	 */
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   98  	static const struct rmap_walk_control rwc = {
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09   99  		.rmap_one = page_idle_clear_pte_refs_one,
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  100  		.anon_lock = page_lock_anon_vma_read,
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  101  	};
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  102  	bool need_lock;
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  103  
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  104  	if (!page_mapped(page) ||
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09 @105  	    !page_rmapping(page))
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  106  		return;
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  107  
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  108  	need_lock = !PageAnon(page) || PageKsm(page);
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  109  	if (need_lock && !trylock_page(page))
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  110  		return;
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  111  
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  112  	rmap_walk(page, (struct rmap_walk_control *)&rwc);
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  113  
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  114  	if (need_lock)
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  115  		unlock_page(page);
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  116  }
33c3fc71c8cfa3 Vladimir Davydov 2015-09-09  117  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8ec63f37a78d..74a05dbdcc19 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1619,8 +1619,6 @@  void page_address_init(void);
 #define page_address_init()  do { } while(0)
 #endif
 
-extern void *page_rmapping(struct page *page);
-extern struct anon_vma *page_anon_vma(struct page *page);
 extern struct address_space *page_mapping(struct page *page);
 
 extern struct address_space *__page_file_mapping(struct page *);
diff --git a/mm/internal.h b/mm/internal.h
index 547a8d7f0cbb..77e0b726eef3 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -358,6 +358,9 @@  void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma,
 		struct vm_area_struct *prev);
 void __vma_unlink_list(struct mm_struct *mm, struct vm_area_struct *vma);
 
+void *page_rmapping(struct page *page);
+struct anon_vma *page_anon_vma(struct page *page);
+
 #ifdef CONFIG_MMU
 extern long populate_vma_page_range(struct vm_area_struct *vma,
 		unsigned long start, unsigned long end, int *nonblocking);