[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202305251051.ulf3fOSD-lkp@intel.com>
Date: Thu, 25 May 2023 11:36:29 +0800
From: kernel test robot <lkp@...el.com>
To: Yang Yang <yang.yang29@....com.cn>, akpm@...ux-foundation.org,
david@...hat.com
Cc: oe-kbuild-all@...ts.linux.dev, yang.yang29@....com.cn,
imbrenda@...ux.ibm.com, jiang.xuexin@....com.cn,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
ran.xiaokai@....com.cn, xu.xin.sc@...il.com, xu.xin16@....com.cn
Subject: Re: [PATCH v9 3/5] ksm: add ksm zero pages for each process
Hi Yang,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.4-rc3 next-20230524]
[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/Yang-Yang/ksm-count-all-zero-pages-placed-by-KSM/20230524-153333
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20230524055800.20498-1-yang.yang29%40zte.com.cn
patch subject: [PATCH v9 3/5] ksm: add ksm zero pages for each process
config: powerpc-allnoconfig
compiler: powerpc-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/c9da8338fa8f95db948cd4d826053d8f6cbcf19c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yang-Yang/ksm-count-all-zero-pages-placed-by-KSM/20230524-153333
git checkout c9da8338fa8f95db948cd4d826053d8f6cbcf19c
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305251051.ulf3fOSD-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
mm/memory.c: In function 'zap_pte_range':
>> mm/memory.c:1419:60: warning: passing argument 1 of 'ksm_notify_unmap_zero_page' makes integer from pointer without a cast [-Wint-conversion]
1419 | ksm_notify_unmap_zero_page(mm, ptent);
| ^~
| |
| struct mm_struct *
In file included from mm/memory.c:56:
include/linux/ksm.h:116:53: note: expected 'pte_t' {aka 'long unsigned int'} but argument is of type 'struct mm_struct *'
116 | static inline void ksm_notify_unmap_zero_page(pte_t pte)
| ~~~~~~^~~
>> mm/memory.c:1419:33: error: too many arguments to function 'ksm_notify_unmap_zero_page'
1419 | ksm_notify_unmap_zero_page(mm, ptent);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/ksm.h:116:20: note: declared here
116 | static inline void ksm_notify_unmap_zero_page(pte_t pte)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
mm/memory.c: In function 'wp_page_copy':
mm/memory.c:3125:52: warning: passing argument 1 of 'ksm_notify_unmap_zero_page' makes integer from pointer without a cast [-Wint-conversion]
3125 | ksm_notify_unmap_zero_page(mm, vmf->orig_pte);
| ^~
| |
| struct mm_struct *
include/linux/ksm.h:116:53: note: expected 'pte_t' {aka 'long unsigned int'} but argument is of type 'struct mm_struct *'
116 | static inline void ksm_notify_unmap_zero_page(pte_t pte)
| ~~~~~~^~~
mm/memory.c:3125:25: error: too many arguments to function 'ksm_notify_unmap_zero_page'
3125 | ksm_notify_unmap_zero_page(mm, vmf->orig_pte);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/ksm.h:116:20: note: declared here
116 | static inline void ksm_notify_unmap_zero_page(pte_t pte)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/ksm_notify_unmap_zero_page +1419 mm/memory.c
1376
1377 static unsigned long zap_pte_range(struct mmu_gather *tlb,
1378 struct vm_area_struct *vma, pmd_t *pmd,
1379 unsigned long addr, unsigned long end,
1380 struct zap_details *details)
1381 {
1382 struct mm_struct *mm = tlb->mm;
1383 int force_flush = 0;
1384 int rss[NR_MM_COUNTERS];
1385 spinlock_t *ptl;
1386 pte_t *start_pte;
1387 pte_t *pte;
1388 swp_entry_t entry;
1389
1390 tlb_change_page_size(tlb, PAGE_SIZE);
1391 again:
1392 init_rss_vec(rss);
1393 start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
1394 pte = start_pte;
1395 flush_tlb_batched_pending(mm);
1396 arch_enter_lazy_mmu_mode();
1397 do {
1398 pte_t ptent = *pte;
1399 struct page *page;
1400
1401 if (pte_none(ptent))
1402 continue;
1403
1404 if (need_resched())
1405 break;
1406
1407 if (pte_present(ptent)) {
1408 unsigned int delay_rmap;
1409
1410 page = vm_normal_page(vma, addr, ptent);
1411 if (unlikely(!should_zap_page(details, page)))
1412 continue;
1413 ptent = ptep_get_and_clear_full(mm, addr, pte,
1414 tlb->fullmm);
1415 tlb_remove_tlb_entry(tlb, pte, addr);
1416 zap_install_uffd_wp_if_needed(vma, addr, pte, details,
1417 ptent);
1418 if (unlikely(!page)) {
> 1419 ksm_notify_unmap_zero_page(mm, ptent);
1420 continue;
1421 }
1422
1423 delay_rmap = 0;
1424 if (!PageAnon(page)) {
1425 if (pte_dirty(ptent)) {
1426 set_page_dirty(page);
1427 if (tlb_delay_rmap(tlb)) {
1428 delay_rmap = 1;
1429 force_flush = 1;
1430 }
1431 }
1432 if (pte_young(ptent) && likely(vma_has_recency(vma)))
1433 mark_page_accessed(page);
1434 }
1435 rss[mm_counter(page)]--;
1436 if (!delay_rmap) {
1437 page_remove_rmap(page, vma, false);
1438 if (unlikely(page_mapcount(page) < 0))
1439 print_bad_pte(vma, addr, ptent, page);
1440 }
1441 if (unlikely(__tlb_remove_page(tlb, page, delay_rmap))) {
1442 force_flush = 1;
1443 addr += PAGE_SIZE;
1444 break;
1445 }
1446 continue;
1447 }
1448
1449 entry = pte_to_swp_entry(ptent);
1450 if (is_device_private_entry(entry) ||
1451 is_device_exclusive_entry(entry)) {
1452 page = pfn_swap_entry_to_page(entry);
1453 if (unlikely(!should_zap_page(details, page)))
1454 continue;
1455 /*
1456 * Both device private/exclusive mappings should only
1457 * work with anonymous page so far, so we don't need to
1458 * consider uffd-wp bit when zap. For more information,
1459 * see zap_install_uffd_wp_if_needed().
1460 */
1461 WARN_ON_ONCE(!vma_is_anonymous(vma));
1462 rss[mm_counter(page)]--;
1463 if (is_device_private_entry(entry))
1464 page_remove_rmap(page, vma, false);
1465 put_page(page);
1466 } else if (!non_swap_entry(entry)) {
1467 /* Genuine swap entry, hence a private anon page */
1468 if (!should_zap_cows(details))
1469 continue;
1470 rss[MM_SWAPENTS]--;
1471 if (unlikely(!free_swap_and_cache(entry)))
1472 print_bad_pte(vma, addr, ptent, NULL);
1473 } else if (is_migration_entry(entry)) {
1474 page = pfn_swap_entry_to_page(entry);
1475 if (!should_zap_page(details, page))
1476 continue;
1477 rss[mm_counter(page)]--;
1478 } else if (pte_marker_entry_uffd_wp(entry)) {
1479 /*
1480 * For anon: always drop the marker; for file: only
1481 * drop the marker if explicitly requested.
1482 */
1483 if (!vma_is_anonymous(vma) &&
1484 !zap_drop_file_uffd_wp(details))
1485 continue;
1486 } else if (is_hwpoison_entry(entry) ||
1487 is_swapin_error_entry(entry)) {
1488 if (!should_zap_cows(details))
1489 continue;
1490 } else {
1491 /* We should have covered all the swap entry types */
1492 WARN_ON_ONCE(1);
1493 }
1494 pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
1495 zap_install_uffd_wp_if_needed(vma, addr, pte, details, ptent);
1496 } while (pte++, addr += PAGE_SIZE, addr != end);
1497
1498 add_mm_rss_vec(mm, rss);
1499 arch_leave_lazy_mmu_mode();
1500
1501 /* Do the actual TLB flush before dropping ptl */
1502 if (force_flush) {
1503 tlb_flush_mmu_tlbonly(tlb);
1504 tlb_flush_rmaps(tlb, vma);
1505 }
1506 pte_unmap_unlock(start_pte, ptl);
1507
1508 /*
1509 * If we forced a TLB flush (either due to running out of
1510 * batch buffers or because we needed to flush dirty TLB
1511 * entries before releasing the ptl), free the batched
1512 * memory too. Restart if we didn't do everything.
1513 */
1514 if (force_flush) {
1515 force_flush = 0;
1516 tlb_flush_mmu(tlb);
1517 }
1518
1519 if (addr != end) {
1520 cond_resched();
1521 goto again;
1522 }
1523
1524 return addr;
1525 }
1526
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
View attachment "config" of type "text/plain" (31019 bytes)
Powered by blists - more mailing lists