On Tue, 26 Sep 2023 09:32:34 +0800 kernel test robot <lkp@xxxxxxxxx> wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable > head: 81fd55e0d6b6bd11a50070f7639c996a0e3aeea8 > commit: 93538f467c0f64ef3fda61cd862115dca782faa4 [264/269] fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs > config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20230926/202309260903.qzpqNFz3-lkp@xxxxxxxxx/config) > compiler: alpha-linux-gcc (GCC) 13.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230926/202309260903.qzpqNFz3-lkp@xxxxxxxxx/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@xxxxxxxxx> > | Closes: https://lore.kernel.org/oe-kbuild-all/202309260903.qzpqNFz3-lkp@xxxxxxxxx/ > > All warnings (new ones prefixed by >>): > > >> fs/proc/task_mmu.c:2018:13: warning: 'pagemap_scan_backout_range' defined but not used [-Wunused-function] > 2018 | static void pagemap_scan_backout_range(struct pagemap_scan_private *p, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > > Thanks. I guess moving the definition inside CONFIG_HUGETLB_PAGE will suffice, --- a/fs/proc/task_mmu.c~fs-proc-task_mmu-implement-ioctl-to-get-and-optionally-clear-info-about-ptes-fix-fix-fix +++ a/fs/proc/task_mmu.c @@ -1940,6 +1940,19 @@ static void make_uffd_wp_huge_pte(struct set_huge_pte_at(vma->vm_mm, addr, ptep, make_pte_marker(PTE_MARKER_UFFD_WP), psize); } + +static void pagemap_scan_backout_range(struct pagemap_scan_private *p, + unsigned long addr, unsigned long end) +{ + struct page_region *cur_buf = &p->vec_buf[p->vec_buf_index]; + + if (cur_buf->start != addr) + cur_buf->end = addr; + else + cur_buf->start = cur_buf->end = 0; + + p->found_pages -= (end - addr) / PAGE_SIZE; +} #endif /* CONFIG_HUGETLB_PAGE */ static bool pagemap_scan_is_interesting_page(unsigned long categories, @@ -2019,19 +2032,6 @@ static bool pagemap_scan_push_range(unsi return true; } -static void pagemap_scan_backout_range(struct pagemap_scan_private *p, - unsigned long addr, unsigned long end) -{ - struct page_region *cur_buf = &p->vec_buf[p->vec_buf_index]; - - if (cur_buf->start != addr) - cur_buf->end = addr; - else - cur_buf->start = cur_buf->end = 0; - - p->found_pages -= (end - addr) / PAGE_SIZE; -} - static int pagemap_scan_output(unsigned long categories, struct pagemap_scan_private *p, unsigned long addr, unsigned long *end) _