CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Yu Zhao <[email protected]>

Hi Yu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on linus/master v5.14-rc6]
[cannot apply to hnaz-linux-mm/master tip/x86/core next-20210818]
[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/Yu-Zhao/Multigenerational-LRU-Framework/20210818-143330
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git 
for-next/core
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: x86_64-randconfig-s021-20210817 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-348-gf0e6938b-dirty
        # 
https://github.com/0day-ci/linux/commit/e51fff45b9822540a91efdeed86f4ee9dabcb1c4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Yu-Zhao/Multigenerational-LRU-Framework/20210818-143330
        git checkout e51fff45b9822540a91efdeed86f4ee9dabcb1c4
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir 
ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


sparse warnings: (new ones prefixed by >>)
   mm/rmap.c: note: in included file (through include/linux/ksm.h):
   include/linux/rmap.h:222:28: sparse: sparse: context imbalance in 
'page_referenced_one' - unexpected unlock
>> mm/rmap.c:1127:6: sparse: sparse: context imbalance in 
>> 'do_page_add_anon_rmap' - different lock contexts for basic block
   include/linux/rmap.h:222:28: sparse: sparse: context imbalance in 
'try_to_unmap_one' - unexpected unlock
   include/linux/rmap.h:222:28: sparse: sparse: context imbalance in 
'try_to_migrate_one' - unexpected unlock
   include/linux/rmap.h:222:28: sparse: sparse: context imbalance in 
'page_mlock_one' - unexpected unlock

vim +/do_page_add_anon_rmap +1127 mm/rmap.c

ad8c2ee801ad7a Rik van Riel            2010-08-09  1121  
ad8c2ee801ad7a Rik van Riel            2010-08-09  1122  /*
ad8c2ee801ad7a Rik van Riel            2010-08-09  1123   * Special version of 
the above for do_swap_page, which often runs
ad8c2ee801ad7a Rik van Riel            2010-08-09  1124   * into pages that are 
exclusively owned by the current process.
ad8c2ee801ad7a Rik van Riel            2010-08-09  1125   * Everybody else 
should continue to use page_add_anon_rmap above.
ad8c2ee801ad7a Rik van Riel            2010-08-09  1126   */
ad8c2ee801ad7a Rik van Riel            2010-08-09 @1127  void 
do_page_add_anon_rmap(struct page *page,
d281ee61451835 Kirill A. Shutemov      2016-01-15  1128         struct 
vm_area_struct *vma, unsigned long address, int flags)
9617d95e6e9ffd Nicholas Piggin         2006-01-06  1129  {
d281ee61451835 Kirill A. Shutemov      2016-01-15  1130         bool compound = 
flags & RMAP_COMPOUND;
53f9263baba69f Kirill A. Shutemov      2016-01-15  1131         bool first;
53f9263baba69f Kirill A. Shutemov      2016-01-15  1132  
be5d0a74c62d8d Johannes Weiner         2020-06-03  1133         if 
(unlikely(PageKsm(page)))
be5d0a74c62d8d Johannes Weiner         2020-06-03  1134                 
lock_page_memcg(page);
be5d0a74c62d8d Johannes Weiner         2020-06-03  1135         else
be5d0a74c62d8d Johannes Weiner         2020-06-03  1136                 
VM_BUG_ON_PAGE(!PageLocked(page), page);
be5d0a74c62d8d Johannes Weiner         2020-06-03  1137  
53f9263baba69f Kirill A. Shutemov      2016-01-15  1138         if (compound) {
53f9263baba69f Kirill A. Shutemov      2016-01-15  1139                 
atomic_t *mapcount;
e9b61f19858a5d Kirill A. Shutemov      2016-01-15  1140                 
VM_BUG_ON_PAGE(!PageLocked(page), page);
53f9263baba69f Kirill A. Shutemov      2016-01-15  1141                 
VM_BUG_ON_PAGE(!PageTransHuge(page), page);
53f9263baba69f Kirill A. Shutemov      2016-01-15  1142                 
mapcount = compound_mapcount_ptr(page);
53f9263baba69f Kirill A. Shutemov      2016-01-15  1143                 first = 
atomic_inc_and_test(mapcount);
53f9263baba69f Kirill A. Shutemov      2016-01-15  1144         } else {
53f9263baba69f Kirill A. Shutemov      2016-01-15  1145                 first = 
atomic_inc_and_test(&page->_mapcount);
53f9263baba69f Kirill A. Shutemov      2016-01-15  1146         }
53f9263baba69f Kirill A. Shutemov      2016-01-15  1147  
53f9263baba69f Kirill A. Shutemov      2016-01-15  1148         if (first) {
6c357848b44b40 Matthew Wilcox (Oracle  2020-08-14  1149)                int nr 
= compound ? thp_nr_pages(page) : 1;
bea04b073292b2 Jianyu Zhan             2014-06-04  1150                 /*
bea04b073292b2 Jianyu Zhan             2014-06-04  1151                  * We 
use the irq-unsafe __{inc|mod}_zone_page_stat because
bea04b073292b2 Jianyu Zhan             2014-06-04  1152                  * 
these counters are not modified in interrupt context, and
bea04b073292b2 Jianyu Zhan             2014-06-04  1153                  * pte 
lock(a spinlock) is held, which implies preemption
bea04b073292b2 Jianyu Zhan             2014-06-04  1154                  * 
disabled.
bea04b073292b2 Jianyu Zhan             2014-06-04  1155                  */
65c453778aea37 Kirill A. Shutemov      2016-07-26  1156                 if 
(compound)
69473e5de87389 Muchun Song             2021-02-24  1157                         
__mod_lruvec_page_state(page, NR_ANON_THPS, nr);
be5d0a74c62d8d Johannes Weiner         2020-06-03  1158                 
__mod_lruvec_page_state(page, NR_ANON_MAPPED, nr);
79134171df2381 Andrea Arcangeli        2011-01-13  1159         }
5ad6468801d28c Hugh Dickins            2009-12-14  1160  
be5d0a74c62d8d Johannes Weiner         2020-06-03  1161         if 
(unlikely(PageKsm(page))) {
be5d0a74c62d8d Johannes Weiner         2020-06-03  1162                 
unlock_page_memcg(page);
be5d0a74c62d8d Johannes Weiner         2020-06-03  1163                 return;
be5d0a74c62d8d Johannes Weiner         2020-06-03  1164         }
53f9263baba69f Kirill A. Shutemov      2016-01-15  1165  
5dbe0af47f8a8f Hugh Dickins            2011-05-28  1166         /* address 
might be in next vma when migration races vma_adjust */
5ad6468801d28c Hugh Dickins            2009-12-14  1167         if (first)
d281ee61451835 Kirill A. Shutemov      2016-01-15  1168                 
__page_set_anon_rmap(page, vma, address,
d281ee61451835 Kirill A. Shutemov      2016-01-15  1169                         
        flags & RMAP_EXCLUSIVE);
69029cd550284e KAMEZAWA Hiroyuki       2008-07-25  1170         else
c97a9e10eaee32 Nicholas Piggin         2007-05-16  1171                 
__page_check_anon_rmap(page, vma, address);
^1da177e4c3f41 Linus Torvalds          2005-04-16  1172  }
^1da177e4c3f41 Linus Torvalds          2005-04-16  1173  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to