linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 6728/7105] mm/rmap.c:1413: warning: Function parameter or struct member 'flags' not described in 'folio_add_new_anon_rmap'
@ 2024-06-19 16:41 kernel test robot
  2024-06-19 21:06 ` Barry Song
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2024-06-19 16:41 UTC (permalink / raw)
  To: Barry Song; +Cc: oe-kbuild-all, Linux Memory Management List, Andrew Morton

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2102cb0d050d34d50b9642a3a50861787527e922
commit: 41bb9aa5f614423659ced668d0f1ff0c1da6552e [6728/7105] mm: extend rmap flags arguments for folio_add_new_anon_rmap
config: arm-pxa910_defconfig (https://download.01.org/0day-ci/archive/20240620/202406200059.tVU9semU-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200059.tVU9semU-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/202406200059.tVU9semU-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/rmap.c:1413: warning: Function parameter or struct member 'flags' not described in 'folio_add_new_anon_rmap'


vim +1413 mm/rmap.c

8bd5130070fbf2 David Hildenbrand       2023-12-20  1398  
43d8eac44f28d3 Randy Dunlap            2008-03-19  1399  /**
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1400)  * folio_add_new_anon_rmap - Add mapping to a new anonymous folio.
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1401)  * @folio:	The folio to add the mapping to.
9617d95e6e9ffd Nicholas Piggin         2006-01-06  1402   * @vma:	the vm area in which the mapping is added
9617d95e6e9ffd Nicholas Piggin         2006-01-06  1403   * @address:	the user virtual address mapped
40f2bbf71161fa David Hildenbrand       2022-05-09  1404   *
84f0169e6c8a61 David Hildenbrand       2023-12-20  1405   * Like folio_add_anon_rmap_*() but must only be called on *new* folios.
9617d95e6e9ffd Nicholas Piggin         2006-01-06  1406   * This means the inc-and-test can be bypassed.
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1407)  * The folio does not have to be locked.
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1408)  *
41bb9aa5f61442 Barry Song              2024-06-18  1409   * If the folio is pmd-mappable, it is accounted as a THP.
9617d95e6e9ffd Nicholas Piggin         2006-01-06  1410   */
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1411) void folio_add_new_anon_rmap(struct folio *folio, struct vm_area_struct *vma,
41bb9aa5f61442 Barry Song              2024-06-18  1412  		unsigned long address, rmap_t flags)
9617d95e6e9ffd Nicholas Piggin         2006-01-06 @1413  {
372cbd4d5a0665 Ryan Roberts            2023-12-07  1414  	int nr = folio_nr_pages(folio);
c2784aaa21dc56 Yosry Ahmed             2024-05-06  1415  	int nr_pmdmapped = 0;
41bb9aa5f61442 Barry Song              2024-06-18  1416  	bool exclusive = flags & RMAP_EXCLUSIVE;
d281ee61451835 Kirill A. Shutemov      2016-01-15  1417  
a4ea18641d8330 David Hildenbrand       2023-12-20  1418  	VM_WARN_ON_FOLIO(folio_test_hugetlb(folio), folio);
372cbd4d5a0665 Ryan Roberts            2023-12-07  1419  	VM_BUG_ON_VMA(address < vma->vm_start ||
372cbd4d5a0665 Ryan Roberts            2023-12-07  1420  			address + (nr << PAGE_SHIFT) > vma->vm_end, vma);
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1421) 	__folio_set_swapbacked(folio);
41bb9aa5f61442 Barry Song              2024-06-18  1422  	__folio_set_anon(folio, vma, address, exclusive);
d8dd5e979d09c7 Hugh Dickins            2022-11-09  1423  
372cbd4d5a0665 Ryan Roberts            2023-12-07  1424  	if (likely(!folio_test_large(folio))) {
d8dd5e979d09c7 Hugh Dickins            2022-11-09  1425  		/* increment count (starts at -1) */
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1426) 		atomic_set(&folio->_mapcount, 0);
41bb9aa5f61442 Barry Song              2024-06-18  1427  		if (exclusive)
372cbd4d5a0665 Ryan Roberts            2023-12-07  1428  			SetPageAnonExclusive(&folio->page);
372cbd4d5a0665 Ryan Roberts            2023-12-07  1429  	} else if (!folio_test_pmd_mappable(folio)) {
372cbd4d5a0665 Ryan Roberts            2023-12-07  1430  		int i;
372cbd4d5a0665 Ryan Roberts            2023-12-07  1431  
372cbd4d5a0665 Ryan Roberts            2023-12-07  1432  		for (i = 0; i < nr; i++) {
372cbd4d5a0665 Ryan Roberts            2023-12-07  1433  			struct page *page = folio_page(folio, i);
372cbd4d5a0665 Ryan Roberts            2023-12-07  1434  
372cbd4d5a0665 Ryan Roberts            2023-12-07  1435  			/* increment count (starts at -1) */
372cbd4d5a0665 Ryan Roberts            2023-12-07  1436  			atomic_set(&page->_mapcount, 0);
41bb9aa5f61442 Barry Song              2024-06-18  1437  			if (exclusive)
372cbd4d5a0665 Ryan Roberts            2023-12-07  1438  				SetPageAnonExclusive(page);
372cbd4d5a0665 Ryan Roberts            2023-12-07  1439  		}
372cbd4d5a0665 Ryan Roberts            2023-12-07  1440  
05c5323b2a344c David Hildenbrand       2024-04-09  1441  		/* increment count (starts at -1) */
05c5323b2a344c David Hildenbrand       2024-04-09  1442  		atomic_set(&folio->_large_mapcount, nr - 1);
372cbd4d5a0665 Ryan Roberts            2023-12-07  1443  		atomic_set(&folio->_nr_pages_mapped, nr);
d8dd5e979d09c7 Hugh Dickins            2022-11-09  1444  	} else {
53f9263baba69f Kirill A. Shutemov      2016-01-15  1445  		/* increment count (starts at -1) */
4d510f3da4c216 Matthew Wilcox (Oracle  2023-01-11  1446) 		atomic_set(&folio->_entire_mapcount, 0);
05c5323b2a344c David Hildenbrand       2024-04-09  1447  		/* increment count (starts at -1) */
05c5323b2a344c David Hildenbrand       2024-04-09  1448  		atomic_set(&folio->_large_mapcount, 0);
e78a13fd16bb9d David Hildenbrand       2023-12-20  1449  		atomic_set(&folio->_nr_pages_mapped, ENTIRELY_MAPPED);
41bb9aa5f61442 Barry Song              2024-06-18  1450  		if (exclusive)
372cbd4d5a0665 Ryan Roberts            2023-12-07  1451  			SetPageAnonExclusive(&folio->page);
c2784aaa21dc56 Yosry Ahmed             2024-05-06  1452  		nr_pmdmapped = nr;
d281ee61451835 Kirill A. Shutemov      2016-01-15  1453  	}
d8dd5e979d09c7 Hugh Dickins            2022-11-09  1454  
c2784aaa21dc56 Yosry Ahmed             2024-05-06  1455  	__folio_mod_stat(folio, nr, nr_pmdmapped);
9617d95e6e9ffd Nicholas Piggin         2006-01-06  1456  }
9617d95e6e9ffd Nicholas Piggin         2006-01-06  1457  

:::::: The code at line 1413 was first introduced by commit
:::::: 9617d95e6e9ffd883cf90a89724fe60d7ab22f9a [PATCH] mm: rmap optimisation

:::::: TO: Nick Piggin <nickpiggin@yahoo.com.au>
:::::: CC: Linus Torvalds <torvalds@g5.osdl.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 6728/7105] mm/rmap.c:1413: warning: Function parameter or struct member 'flags' not described in 'folio_add_new_anon_rmap'
  2024-06-19 16:41 [linux-next:master 6728/7105] mm/rmap.c:1413: warning: Function parameter or struct member 'flags' not described in 'folio_add_new_anon_rmap' kernel test robot
@ 2024-06-19 21:06 ` Barry Song
  2024-06-20  6:57   ` Liu, Yujie
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Song @ 2024-06-19 21:06 UTC (permalink / raw)
  To: lkp; +Cc: akpm, linux-mm, oe-kbuild-all, v-songbaohua

>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   2102cb0d050d34d50b9642a3a50861787527e922
> commit: 41bb9aa5f614423659ced668d0f1ff0c1da6552e [6728/7105] mm: extend rmap flags arguments for folio_add_new_anon_rmap
> config: arm-pxa910_defconfig (https://download.01.org/0day-ci/archive/20240620/202406200059.tVU9semU-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200059.tVU9semU-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/202406200059.tVU9semU-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> mm/rmap.c:1413: warning: Function parameter or struct member 'flags' not described in 'folio_add_new_anon_rmap'
>

Hi, Thanks very much for the report!

Would you test if the below patch fix the WARNING?

From: Barry Song <v-songbaohua@oppo.com>
Date: Thu, 20 Jun 2024 08:57:55 +1200
Subject: [PATCH] mm: fix the missing doc for flags of
 folio_add_new_anon_rmap()

Fix mm/rmap.c:1413: warning: Function parameter or struct member
'flags' not described in 'folio_add_new_anon_rmap'.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406200059.tVU9semU-lkp@intel.com/
Signed-off-by: Barry Song <v-songbaohua@oppo.com>
---
 mm/rmap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/rmap.c b/mm/rmap.c
index 9b7310120ccb..df1a43295c85 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1390,6 +1390,7 @@ void folio_add_anon_rmap_pmd(struct folio *folio, struct page *page,
  * @folio:	The folio to add the mapping to.
  * @vma:	the vm area in which the mapping is added
  * @address:	the user virtual address mapped
+ * @flags:	The rmap flags
  *
  * Like folio_add_anon_rmap_*() but must only be called on *new* folios.
  * This means the inc-and-test can be bypassed.
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 6728/7105] mm/rmap.c:1413: warning: Function parameter or struct member 'flags' not described in 'folio_add_new_anon_rmap'
  2024-06-19 21:06 ` Barry Song
@ 2024-06-20  6:57   ` Liu, Yujie
  0 siblings, 0 replies; 3+ messages in thread
From: Liu, Yujie @ 2024-06-20  6:57 UTC (permalink / raw)
  To: 21cnbao, lkp; +Cc: v-songbaohua, linux-mm, oe-kbuild-all, akpm

On Thu, 2024-06-20 at 09:06 +1200, Barry Song wrote:
> > 
> > tree:  
> > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> > master
> > head:   2102cb0d050d34d50b9642a3a50861787527e922
> > commit: 41bb9aa5f614423659ced668d0f1ff0c1da6552e [6728/7105] mm:
> > extend rmap flags arguments for folio_add_new_anon_rmap
> > config: arm-pxa910_defconfig
> > (https://download.01.org/0day-ci/archive/20240620/202406200059.tVU9
> > semU-lkp@intel.com/config)
> > compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> > reproduce (this is a W=1 build):
> > (https://download.01.org/0day-ci/archive/20240620/202406200059.tVU9
> > semU-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/202406200059.tVU9semU-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> > > > mm/rmap.c:1413: warning: Function parameter or struct member
> > > > 'flags' not described in 'folio_add_new_anon_rmap'
> > 
> 
> Hi, Thanks very much for the report!
> 
> Would you test if the below patch fix the WARNING?

Thanks for sending the patch. It fixes the doc warning for me.

Tested-by: Yujie Liu <yujie.liu@intel.com>

> From: Barry Song <v-songbaohua@oppo.com>
> Date: Thu, 20 Jun 2024 08:57:55 +1200
> Subject: [PATCH] mm: fix the missing doc for flags of
>  folio_add_new_anon_rmap()
> 
> Fix mm/rmap.c:1413: warning: Function parameter or struct member
> 'flags' not described in 'folio_add_new_anon_rmap'.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes:
> https://lore.kernel.org/oe-kbuild-all/202406200059.tVU9semU-lkp@intel.com/
> Signed-off-by: Barry Song <v-songbaohua@oppo.com>
> ---
>  mm/rmap.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 9b7310120ccb..df1a43295c85 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1390,6 +1390,7 @@ void folio_add_anon_rmap_pmd(struct folio
> *folio, struct page *page,
>   * @folio:	The folio to add the mapping to.
>   * @vma:	the vm area in which the mapping is added
>   * @address:	the user virtual address mapped
> + * @flags:	The rmap flags
>   *
>   * Like folio_add_anon_rmap_*() but must only be called on *new*
> folios.
>   * This means the inc-and-test can be bypassed.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-20  6:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-19 16:41 [linux-next:master 6728/7105] mm/rmap.c:1413: warning: Function parameter or struct member 'flags' not described in 'folio_add_new_anon_rmap' kernel test robot
2024-06-19 21:06 ` Barry Song
2024-06-20  6:57   ` Liu, Yujie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox