All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yan Zhao <yan.y.zhao@intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC PATCH v2 4/5] mm/autonuma: call .numa_protect() when page is protected for NUMA migrate
Date: Thu, 10 Aug 2023 21:55:41 +0800	[thread overview]
Message-ID: <202308102157.wk3FSpe2-lkp@intel.com> (raw)
In-Reply-To: <20230810090048.26184-1-yan.y.zhao@intel.com>

Hi Yan,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on kvm/queue]
[also build test ERROR on mst-vhost/linux-next linus/master]
[cannot apply to akpm-mm/mm-everything kvm/linux-next]
[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/Yan-Zhao/mm-mmu_notifier-introduce-a-new-mmu-notifier-flag-MMU_NOTIFIER_RANGE_NUMA/20230810-172955
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link:    https://lore.kernel.org/r/20230810090048.26184-1-yan.y.zhao%40intel.com
patch subject: [RFC PATCH v2 4/5] mm/autonuma: call .numa_protect() when page is protected for NUMA migrate
config: x86_64-buildonly-randconfig-r003-20230809 (https://download.01.org/0day-ci/archive/20230810/202308102157.wk3FSpe2-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230810/202308102157.wk3FSpe2-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/202308102157.wk3FSpe2-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/huge_memory.c: In function 'change_huge_pmd':
>> mm/huge_memory.c:1895:17: error: implicit declaration of function 'mmu_notifier_numa_protect' [-Werror=implicit-function-declaration]
    1895 |                 mmu_notifier_numa_protect(vma->vm_mm, addr, addr + PMD_SIZE);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/mmu_notifier_numa_protect +1895 mm/huge_memory.c

  1862	
  1863		if (prot_numa) {
  1864			struct page *page;
  1865			bool toptier;
  1866			/*
  1867			 * Avoid trapping faults against the zero page. The read-only
  1868			 * data is likely to be read-cached on the local CPU and
  1869			 * local/remote hits to the zero page are not interesting.
  1870			 */
  1871			if (is_huge_zero_pmd(*pmd))
  1872				goto unlock;
  1873	
  1874			if (pmd_protnone(*pmd))
  1875				goto unlock;
  1876	
  1877			page = pmd_page(*pmd);
  1878	
  1879			if (PageAnon(page) && PageAnonExclusive(page) &&
  1880			    page_maybe_dma_pinned(page))
  1881				goto unlock;
  1882	
  1883			toptier = node_is_toptier(page_to_nid(page));
  1884			/*
  1885			 * Skip scanning top tier node if normal numa
  1886			 * balancing is disabled
  1887			 */
  1888			if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_NORMAL) &&
  1889			    toptier)
  1890				goto unlock;
  1891	
  1892			if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING &&
  1893			    !toptier)
  1894				xchg_page_access_time(page, jiffies_to_msecs(jiffies));
> 1895			mmu_notifier_numa_protect(vma->vm_mm, addr, addr + PMD_SIZE);
  1896		}
  1897		/*
  1898		 * In case prot_numa, we are under mmap_read_lock(mm). It's critical
  1899		 * to not clear pmd intermittently to avoid race with MADV_DONTNEED
  1900		 * which is also under mmap_read_lock(mm):
  1901		 *
  1902		 *	CPU0:				CPU1:
  1903		 *				change_huge_pmd(prot_numa=1)
  1904		 *				 pmdp_huge_get_and_clear_notify()
  1905		 * madvise_dontneed()
  1906		 *  zap_pmd_range()
  1907		 *   pmd_trans_huge(*pmd) == 0 (without ptl)
  1908		 *   // skip the pmd
  1909		 *				 set_pmd_at();
  1910		 *				 // pmd is re-established
  1911		 *
  1912		 * The race makes MADV_DONTNEED miss the huge pmd and don't clear it
  1913		 * which may break userspace.
  1914		 *
  1915		 * pmdp_invalidate_ad() is required to make sure we don't miss
  1916		 * dirty/young flags set by hardware.
  1917		 */
  1918		oldpmd = pmdp_invalidate_ad(vma, addr, pmd);
  1919	
  1920		entry = pmd_modify(oldpmd, newprot);
  1921		if (uffd_wp)
  1922			entry = pmd_mkuffd_wp(entry);
  1923		else if (uffd_wp_resolve)
  1924			/*
  1925			 * Leave the write bit to be handled by PF interrupt
  1926			 * handler, then things like COW could be properly
  1927			 * handled.
  1928			 */
  1929			entry = pmd_clear_uffd_wp(entry);
  1930	
  1931		/* See change_pte_range(). */
  1932		if ((cp_flags & MM_CP_TRY_CHANGE_WRITABLE) && !pmd_write(entry) &&
  1933		    can_change_pmd_writable(vma, addr, entry))
  1934			entry = pmd_mkwrite(entry);
  1935	
  1936		ret = HPAGE_PMD_NR;
  1937		set_pmd_at(mm, addr, pmd, entry);
  1938	
  1939		if (huge_pmd_needs_flush(oldpmd, entry))
  1940			tlb_flush_pmd_range(tlb, addr, HPAGE_PMD_SIZE);
  1941	unlock:
  1942		spin_unlock(ptl);
  1943		return ret;
  1944	}
  1945	

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

  parent reply	other threads:[~2023-08-10 14:22 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  8:56 [RFC PATCH v2 0/5] Reduce NUMA balance caused TLB-shootdowns in a VM Yan Zhao
2023-08-10  8:57 ` [RFC PATCH v2 1/5] mm/mmu_notifier: introduce a new mmu notifier flag MMU_NOTIFIER_RANGE_NUMA Yan Zhao
2023-08-10  8:58 ` [RFC PATCH v2 2/5] mm: don't set PROT_NONE to maybe-dma-pinned pages for NUMA-migrate purpose Yan Zhao
2023-08-10  9:00 ` [RFC PATCH v2 3/5] mm/mmu_notifier: introduce a new callback .numa_protect Yan Zhao
2023-08-10  9:00 ` [RFC PATCH v2 4/5] mm/autonuma: call .numa_protect() when page is protected for NUMA migrate Yan Zhao
2023-08-10 13:45   ` kernel test robot
2023-08-10 13:55   ` kernel test robot [this message]
2023-08-11 18:52   ` Nadav Amit
2023-08-14  7:52     ` Yan Zhao
2023-08-10  9:02 ` [RFC PATCH v2 5/5] KVM: Unmap pages only when it's indeed protected for NUMA migration Yan Zhao
2023-08-10 13:16   ` bibo mao
2023-08-11  3:45     ` Yan Zhao
2023-08-11  7:40       ` bibo mao
2023-08-11  8:01         ` Yan Zhao
2023-08-11 17:14           ` Sean Christopherson
2023-08-11 17:18             ` Jason Gunthorpe
2023-08-14  6:52             ` Yan Zhao
2023-08-14  7:44               ` Yan Zhao
2023-08-14 16:40               ` Sean Christopherson
2023-08-15  1:54                 ` Yan Zhao
2023-08-15 14:50                   ` Sean Christopherson
2023-08-16  2:43                     ` bibo mao
2023-08-16  3:44                       ` bibo mao
2023-08-16  5:14                         ` Yan Zhao
2023-08-16  7:29                           ` bibo mao
2023-08-16  7:18                             ` Yan Zhao
2023-08-16  7:53                               ` bibo mao
2023-08-16 13:39                                 ` Sean Christopherson
2023-08-10 15:19   ` kernel test robot
2023-08-10  9:34 ` [RFC PATCH v2 0/5] Reduce NUMA balance caused TLB-shootdowns in a VM David Hildenbrand
2023-08-10  9:50   ` Yan Zhao
2023-08-11 17:25     ` David Hildenbrand
2023-08-11 18:20       ` John Hubbard
2023-08-11 18:39         ` David Hildenbrand
2023-08-11 19:35           ` John Hubbard
2023-08-14  9:09             ` Yan Zhao
2023-08-15  2:34               ` John Hubbard
2023-08-16  7:43                 ` David Hildenbrand
2023-08-16  9:06                   ` Yan Zhao
2023-08-16  9:49                     ` David Hildenbrand
2023-08-16 18:00                       ` John Hubbard
2023-08-17  5:05                         ` Yan Zhao
2023-08-17  7:38                           ` David Hildenbrand
2023-08-18  0:13                             ` Yan Zhao
2023-08-18  2:29                               ` John Hubbard
2023-09-04  9:18                                 ` Yan Zhao
2023-08-15  2:36               ` Yuan Yao
2023-08-15  2:37                 ` Yan Zhao
2023-08-10 13:58 ` Chao Gao
2023-08-11  5:22   ` Yan Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202308102157.wk3FSpe2-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yan.y.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.