* Re: [PATCH 1/4] hugetlb: skip to end of PT page mapping when pte not present
[not found] <20220616210518.125287-2-mike.kravetz@oracle.com>
@ 2022-06-17 11:26 ` kernel test robot
2022-06-17 21:09 ` Mike Kravetz
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-06-17 11:26 UTC (permalink / raw)
To: Mike Kravetz, linux-kernel, linux-mm, linux-arm-kernel,
linux-s390, linux-sh, sparclinux, linux-ia64, linux-mips,
linux-parisc, linuxppc-dev
Cc: llvm, kbuild-all, Muchun Song, Baolin Wang, Michal Hocko,
Peter Xu, Naoya Horiguchi, James Houghton, Mina Almasry,
Aneesh Kumar K . V, Anshuman Khandual, Paul Walmsley,
Christian Borntraeger, catalin.marinas, will, Andrew Morton,
Linux Memory Management List, Mike Kravetz
Hi Mike,
I love your patch! Yet something to improve:
[auto build test ERROR on soc/for-next]
[also build test ERROR on linus/master v5.19-rc2 next-20220617]
[cannot apply to arm64/for-next/core arm/for-next kvmarm/next xilinx-xlnx/master]
[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/intel-lab-lkp/linux/commits/Mike-Kravetz/hugetlb-speed-up-linear-address-scanning/20220617-050726
base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: i386-randconfig-a002 (https://download.01.org/0day-ci/archive/20220617/202206171929.ZIUrNg6p-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f0e608de27b3d568000046eebf3712ab542979d6)
reproduce (this is a W=1 build):
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/4c647687607f10fece04967b8180c0dadaf765e6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Mike-Kravetz/hugetlb-speed-up-linear-address-scanning/20220617-050726
git checkout 4c647687607f10fece04967b8180c0dadaf765e6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> mm/hugetlb.c:6901:7: error: duplicate case value '4194304'
case PUD_SIZE:
^
include/asm-generic/pgtable-nopud.h:20:20: note: expanded from macro 'PUD_SIZE'
#define PUD_SIZE (1UL << PUD_SHIFT)
^
mm/hugetlb.c:6899:7: note: previous case defined here
case P4D_SIZE:
^
include/asm-generic/pgtable-nop4d.h:13:19: note: expanded from macro 'P4D_SIZE'
#define P4D_SIZE (1UL << P4D_SHIFT)
^
mm/hugetlb.c:6903:7: error: duplicate case value '4194304'
case PMD_SIZE:
^
include/asm-generic/pgtable-nopmd.h:22:20: note: expanded from macro 'PMD_SIZE'
#define PMD_SIZE (1UL << PMD_SHIFT)
^
mm/hugetlb.c:6901:7: note: previous case defined here
case PUD_SIZE:
^
include/asm-generic/pgtable-nopud.h:20:20: note: expanded from macro 'PUD_SIZE'
#define PUD_SIZE (1UL << PUD_SHIFT)
^
2 errors generated.
vim +/4194304 +6901 mm/hugetlb.c
6886
6887 /*
6888 * Return a mask that can be used to update an address to the last huge
6889 * page in a page table page mapping size. Used to skip non-present
6890 * page table entries when linearly scanning address ranges. Architectures
6891 * with unique huge page to page table relationships can define their own
6892 * version of this routine.
6893 */
6894 unsigned long hugetlb_mask_last_page(struct hstate *h)
6895 {
6896 unsigned long hp_size = huge_page_size(h);
6897
6898 switch (hp_size) {
6899 case P4D_SIZE:
6900 return PGDIR_SIZE - P4D_SIZE;
> 6901 case PUD_SIZE:
6902 return P4D_SIZE - PUD_SIZE;
6903 case PMD_SIZE:
6904 return PUD_SIZE - PMD_SIZE;
6905 default:
6906 break; /* Should never happen */
6907 }
6908
6909 return ~(0UL);
6910 }
6911
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/4] hugetlb: skip to end of PT page mapping when pte not present
2022-06-17 11:26 ` [PATCH 1/4] hugetlb: skip to end of PT page mapping when pte not present kernel test robot
@ 2022-06-17 21:09 ` Mike Kravetz
0 siblings, 0 replies; 2+ messages in thread
From: Mike Kravetz @ 2022-06-17 21:09 UTC (permalink / raw)
To: kernel test robot
Cc: linux-kernel, linux-mm, linux-arm-kernel, linux-s390, linux-sh,
sparclinux, linux-ia64, linux-mips, linux-parisc, linuxppc-dev,
llvm, kbuild-all, Muchun Song, Baolin Wang, Michal Hocko,
Peter Xu, Naoya Horiguchi, James Houghton, Mina Almasry,
Aneesh Kumar K . V, Anshuman Khandual, Paul Walmsley,
Christian Borntraeger, catalin.marinas, will, Andrew Morton
On 06/17/22 19:26, kernel test robot wrote:
> Hi Mike,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on soc/for-next]
> [also build test ERROR on linus/master v5.19-rc2 next-20220617]
> [cannot apply to arm64/for-next/core arm/for-next kvmarm/next xilinx-xlnx/master]
> [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/intel-lab-lkp/linux/commits/Mike-Kravetz/hugetlb-speed-up-linear-address-scanning/20220617-050726
> base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
> config: i386-randconfig-a002 (https://download.01.org/0day-ci/archive/20220617/202206171929.ZIUrNg6p-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f0e608de27b3d568000046eebf3712ab542979d6)
> reproduce (this is a W=1 build):
> 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/4c647687607f10fece04967b8180c0dadaf765e6
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Mike-Kravetz/hugetlb-speed-up-linear-address-scanning/20220617-050726
> git checkout 4c647687607f10fece04967b8180c0dadaf765e6
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
A couple of things here,
>
> >> mm/hugetlb.c:6901:7: error: duplicate case value '4194304'
> case PUD_SIZE:
> ^
> include/asm-generic/pgtable-nopud.h:20:20: note: expanded from macro 'PUD_SIZE'
> #define PUD_SIZE (1UL << PUD_SHIFT)
> ^
> mm/hugetlb.c:6899:7: note: previous case defined here
> case P4D_SIZE:
> ^
> include/asm-generic/pgtable-nop4d.h:13:19: note: expanded from macro 'P4D_SIZE'
> #define P4D_SIZE (1UL << P4D_SHIFT)
In the CONFIG_ARCH_WANT_GENERAL_HUGETLB case covered by this version of
hugetlb_mask_last_page, huge pages can only be PMD_SIZE or PUD_SIZE.
So, the 'case P4D_SIZE:' should not exist and can be removed.
> ^
> mm/hugetlb.c:6903:7: error: duplicate case value '4194304'
> case PMD_SIZE:
> ^
> include/asm-generic/pgtable-nopmd.h:22:20: note: expanded from macro 'PMD_SIZE'
> #define PMD_SIZE (1UL << PMD_SHIFT)
> ^
On i386 with CONFIG_PGTABLE_LEVELS=2, PUD_SIZE == PMD_SIZE.
Originally, I coded this as a if .. else if ... statement instead of a
switch. If coded this way, the compiler does not complain about the
duplicate values. The only other alternative I can think of is
something like '#if CONFIG_PGTABLE_LEVELS > 2' around the PUD_SIZE case.
I would prefer the if else if, unless someone can suggest something else?
--
Mike Kravetz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-17 21:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220616210518.125287-2-mike.kravetz@oracle.com>
2022-06-17 11:26 ` [PATCH 1/4] hugetlb: skip to end of PT page mapping when pte not present kernel test robot
2022-06-17 21:09 ` Mike Kravetz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox