tree: https://github.com/norov/linux bitmap-20210716 head: 8ac80f856c70d69f310de6215244b6aaeb22d5b9 commit: a2d6e02d19450a49a55f08c151d1f704723bec1a [15/17] bitmap: unify find_bit operations config: powerpc64-buildonly-randconfig-r002-20210719 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 5d5b08761f944d5b9822d582378333cc4b36a0a7) 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 # install powerpc64 cross compiling tool for clang build # apt-get install binutils-powerpc64-linux-gnu # https://github.com/norov/linux/commit/a2d6e02d19450a49a55f08c151d1f704723bec1a git remote add norov https://github.com/norov/linux git fetch --no-tags norov bitmap-20210716 git checkout a2d6e02d19450a49a55f08c151d1f704723bec1a # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from fs/btrfs/extent_io.c:5: In file included from include/linux/bio.h:8: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ :88:1: note: expanded from here __do_insw ^ arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw' #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/btrfs/extent_io.c:5: In file included from include/linux/bio.h:8: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ :90:1: note: expanded from here __do_insl ^ arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl' #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/btrfs/extent_io.c:5: In file included from include/linux/bio.h:8: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ :92:1: note: expanded from here __do_outsb ^ arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb' #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/btrfs/extent_io.c:5: In file included from include/linux/bio.h:8: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ :94:1: note: expanded from here __do_outsw ^ arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw' #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/btrfs/extent_io.c:5: In file included from include/linux/bio.h:8: In file included from include/linux/highmem.h:10: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:619: arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ :96:1: note: expanded from here __do_outsl ^ arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl' #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ >> fs/btrfs/extent_io.c:3809:2: error: implicit declaration of function 'bitmap_next_set_region' [-Werror,-Wimplicit-function-declaration] bitmap_next_set_region(&dirty_bitmap, &range_start_bit, &range_end_bit, ^ fs/btrfs/extent_io.c:3809:2: note: did you mean 'bitmap_release_region'? include/linux/bitmap.h:213:6: note: 'bitmap_release_region' declared here void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order); ^ 6 warnings and 1 error generated. vim +/bitmap_next_set_region +3809 fs/btrfs/extent_io.c 40f765805f082ed Chris Mason 2014-05-21 3766 c5ef5c6c733a087 Qu Wenruo 2021-05-31 3767 /* c5ef5c6c733a087 Qu Wenruo 2021-05-31 3768 * Find the first byte we need to write. c5ef5c6c733a087 Qu Wenruo 2021-05-31 3769 * c5ef5c6c733a087 Qu Wenruo 2021-05-31 3770 * For subpage, one page can contain several sectors, and c5ef5c6c733a087 Qu Wenruo 2021-05-31 3771 * __extent_writepage_io() will just grab all extent maps in the page c5ef5c6c733a087 Qu Wenruo 2021-05-31 3772 * range and try to submit all non-inline/non-compressed extents. c5ef5c6c733a087 Qu Wenruo 2021-05-31 3773 * c5ef5c6c733a087 Qu Wenruo 2021-05-31 3774 * This is a big problem for subpage, we shouldn't re-submit already written c5ef5c6c733a087 Qu Wenruo 2021-05-31 3775 * data at all. c5ef5c6c733a087 Qu Wenruo 2021-05-31 3776 * This function will lookup subpage dirty bit to find which range we really c5ef5c6c733a087 Qu Wenruo 2021-05-31 3777 * need to submit. c5ef5c6c733a087 Qu Wenruo 2021-05-31 3778 * c5ef5c6c733a087 Qu Wenruo 2021-05-31 3779 * Return the next dirty range in [@start, @end). c5ef5c6c733a087 Qu Wenruo 2021-05-31 3780 * If no dirty range is found, @start will be page_offset(page) + PAGE_SIZE. c5ef5c6c733a087 Qu Wenruo 2021-05-31 3781 */ c5ef5c6c733a087 Qu Wenruo 2021-05-31 3782 static void find_next_dirty_byte(struct btrfs_fs_info *fs_info, c5ef5c6c733a087 Qu Wenruo 2021-05-31 3783 struct page *page, u64 *start, u64 *end) c5ef5c6c733a087 Qu Wenruo 2021-05-31 3784 { c5ef5c6c733a087 Qu Wenruo 2021-05-31 3785 struct btrfs_subpage *subpage = (struct btrfs_subpage *)page->private; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3786 u64 orig_start = *start; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3787 /* Declare as unsigned long so we can use bitmap ops */ c5ef5c6c733a087 Qu Wenruo 2021-05-31 3788 unsigned long dirty_bitmap; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3789 unsigned long flags; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3790 int nbits = (orig_start - page_offset(page)) >> fs_info->sectorsize_bits; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3791 int range_start_bit = nbits; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3792 int range_end_bit; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3793 c5ef5c6c733a087 Qu Wenruo 2021-05-31 3794 /* c5ef5c6c733a087 Qu Wenruo 2021-05-31 3795 * For regular sector size == page size case, since one page only c5ef5c6c733a087 Qu Wenruo 2021-05-31 3796 * contains one sector, we return the page offset directly. c5ef5c6c733a087 Qu Wenruo 2021-05-31 3797 */ c5ef5c6c733a087 Qu Wenruo 2021-05-31 3798 if (fs_info->sectorsize == PAGE_SIZE) { c5ef5c6c733a087 Qu Wenruo 2021-05-31 3799 *start = page_offset(page); c5ef5c6c733a087 Qu Wenruo 2021-05-31 3800 *end = page_offset(page) + PAGE_SIZE; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3801 return; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3802 } c5ef5c6c733a087 Qu Wenruo 2021-05-31 3803 c5ef5c6c733a087 Qu Wenruo 2021-05-31 3804 /* We should have the page locked, but just in case */ c5ef5c6c733a087 Qu Wenruo 2021-05-31 3805 spin_lock_irqsave(&subpage->lock, flags); c5ef5c6c733a087 Qu Wenruo 2021-05-31 3806 dirty_bitmap = subpage->dirty_bitmap; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3807 spin_unlock_irqrestore(&subpage->lock, flags); c5ef5c6c733a087 Qu Wenruo 2021-05-31 3808 c5ef5c6c733a087 Qu Wenruo 2021-05-31 @3809 bitmap_next_set_region(&dirty_bitmap, &range_start_bit, &range_end_bit, c5ef5c6c733a087 Qu Wenruo 2021-05-31 3810 BTRFS_SUBPAGE_BITMAP_SIZE); c5ef5c6c733a087 Qu Wenruo 2021-05-31 3811 *start = page_offset(page) + range_start_bit * fs_info->sectorsize; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3812 *end = page_offset(page) + range_end_bit * fs_info->sectorsize; c5ef5c6c733a087 Qu Wenruo 2021-05-31 3813 } c5ef5c6c733a087 Qu Wenruo 2021-05-31 3814 :::::: The code at line 3809 was first introduced by commit :::::: c5ef5c6c733a087fc3f8b298010d7e6911bff1e3 btrfs: make __extent_writepage_io() only submit dirty range for subpage :::::: TO: Qu Wenruo :::::: CC: David Sterba --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org