Hi Tamir, First bad commit (maybe != root cause): tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable head: f635cc53910d4ba7726f925e49ce57c5332cd6a1 commit: 560b566c00a2d0b089af0cae62f146f61331e4fe [79/80] xarray: port tests to kunit config: i386-randconfig-051-20241208 (https://download.01.org/0day-ci/archive/20241208/202412081700.YXB3vBbg-lkp@xxxxxxxxx/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 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/202412081700.YXB3vBbg-lkp@xxxxxxxxx/ cocci warnings: (new ones prefixed by >>) >> lib/test_xarray.c:1019:52-53: WARNING comparing pointer to 0 vim +1019 lib/test_xarray.c a60cc288a1a260 Luis Chamberlain 2024-01-31 950 560b566c00a2d0 Tamir Duberstein 2024-12-05 951 static noinline void check_xa_alloc_1(struct kunit *test, struct xarray *xa, unsigned int base) 371c752dc66948 Matthew Wilcox 2018-07-04 952 { 371c752dc66948 Matthew Wilcox 2018-07-04 953 int i; 371c752dc66948 Matthew Wilcox 2018-07-04 954 u32 id; 371c752dc66948 Matthew Wilcox 2018-07-04 955 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 956 XA_BUG_ON(xa, !xa_empty(xa)); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 957 /* An empty array should assign %base to the first alloc */ 560b566c00a2d0 Tamir Duberstein 2024-12-05 958 xa_alloc_index(test, xa, base, GFP_KERNEL); 371c752dc66948 Matthew Wilcox 2018-07-04 959 371c752dc66948 Matthew Wilcox 2018-07-04 960 /* Erasing it should make the array empty again */ 560b566c00a2d0 Tamir Duberstein 2024-12-05 961 xa_erase_index(test, xa, base); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 962 XA_BUG_ON(xa, !xa_empty(xa)); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 963 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 964 /* And it should assign %base again */ 560b566c00a2d0 Tamir Duberstein 2024-12-05 965 xa_alloc_index(test, xa, base, GFP_KERNEL); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 966 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 967 /* Allocating and then erasing a lot should not lose base */ 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 968 for (i = base + 1; i < 2 * XA_CHUNK_SIZE; i++) 560b566c00a2d0 Tamir Duberstein 2024-12-05 969 xa_alloc_index(test, xa, i, GFP_KERNEL); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 970 for (i = base; i < 2 * XA_CHUNK_SIZE; i++) 560b566c00a2d0 Tamir Duberstein 2024-12-05 971 xa_erase_index(test, xa, i); 560b566c00a2d0 Tamir Duberstein 2024-12-05 972 xa_alloc_index(test, xa, base, GFP_KERNEL); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 973 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 974 /* Destroying the array should do the same as erasing */ 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 975 xa_destroy(xa); 371c752dc66948 Matthew Wilcox 2018-07-04 976 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 977 /* And it should assign %base again */ 560b566c00a2d0 Tamir Duberstein 2024-12-05 978 xa_alloc_index(test, xa, base, GFP_KERNEL); 371c752dc66948 Matthew Wilcox 2018-07-04 979 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 980 /* The next assigned ID should be base+1 */ 560b566c00a2d0 Tamir Duberstein 2024-12-05 981 xa_alloc_index(test, xa, base + 1, GFP_KERNEL); 560b566c00a2d0 Tamir Duberstein 2024-12-05 982 xa_erase_index(test, xa, base + 1); 371c752dc66948 Matthew Wilcox 2018-07-04 983 371c752dc66948 Matthew Wilcox 2018-07-04 984 /* Storing a value should mark it used */ 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 985 xa_store_index(xa, base + 1, GFP_KERNEL); 560b566c00a2d0 Tamir Duberstein 2024-12-05 986 xa_alloc_index(test, xa, base + 2, GFP_KERNEL); 371c752dc66948 Matthew Wilcox 2018-07-04 987 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 988 /* If we then erase base, it should be free */ 560b566c00a2d0 Tamir Duberstein 2024-12-05 989 xa_erase_index(test, xa, base); 560b566c00a2d0 Tamir Duberstein 2024-12-05 990 xa_alloc_index(test, xa, base, GFP_KERNEL); 371c752dc66948 Matthew Wilcox 2018-07-04 991 560b566c00a2d0 Tamir Duberstein 2024-12-05 992 xa_erase_index(test, xa, base + 1); 560b566c00a2d0 Tamir Duberstein 2024-12-05 993 xa_erase_index(test, xa, base + 2); 371c752dc66948 Matthew Wilcox 2018-07-04 994 371c752dc66948 Matthew Wilcox 2018-07-04 995 for (i = 1; i < 5000; i++) { 560b566c00a2d0 Tamir Duberstein 2024-12-05 996 xa_alloc_index(test, xa, base + i, GFP_KERNEL); 371c752dc66948 Matthew Wilcox 2018-07-04 997 } 371c752dc66948 Matthew Wilcox 2018-07-04 998 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 999 xa_destroy(xa); 371c752dc66948 Matthew Wilcox 2018-07-04 1000 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 1001 /* Check that we fail properly at the limit of allocation */ a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1002 XA_BUG_ON(xa, xa_alloc(xa, &id, xa_mk_index(UINT_MAX - 1), a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1003 XA_LIMIT(UINT_MAX - 1, UINT_MAX), 371c752dc66948 Matthew Wilcox 2018-07-04 1004 GFP_KERNEL) != 0); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 1005 XA_BUG_ON(xa, id != 0xfffffffeU); a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1006 XA_BUG_ON(xa, xa_alloc(xa, &id, xa_mk_index(UINT_MAX), a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1007 XA_LIMIT(UINT_MAX - 1, UINT_MAX), 371c752dc66948 Matthew Wilcox 2018-07-04 1008 GFP_KERNEL) != 0); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 1009 XA_BUG_ON(xa, id != 0xffffffffU); a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1010 id = 3; a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1011 XA_BUG_ON(xa, xa_alloc(xa, &id, xa_mk_index(0), a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1012 XA_LIMIT(UINT_MAX - 1, UINT_MAX), a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1013 GFP_KERNEL) != -EBUSY); a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1014 XA_BUG_ON(xa, id != 3); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 1015 xa_destroy(xa); 48483614de97c4 Matthew Wilcox 2018-12-13 1016 a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1017 XA_BUG_ON(xa, xa_alloc(xa, &id, xa_mk_index(10), XA_LIMIT(10, 5), a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1018 GFP_KERNEL) != -EBUSY); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 @1019 XA_BUG_ON(xa, xa_store_index(xa, 3, GFP_KERNEL) != 0); a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1020 XA_BUG_ON(xa, xa_alloc(xa, &id, xa_mk_index(10), XA_LIMIT(10, 5), a3e4d3f97ec844 Matthew Wilcox 2018-12-31 1021 GFP_KERNEL) != -EBUSY); 560b566c00a2d0 Tamir Duberstein 2024-12-05 1022 xa_erase_index(test, xa, 3); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 1023 XA_BUG_ON(xa, !xa_empty(xa)); 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 1024 } 3ccaf57a6a63ad Matthew Wilcox 2018-10-26 1025 :::::: The code at line 1019 was first introduced by commit :::::: 3ccaf57a6a63ad171a951dcaddffc453b2414c7b XArray: Add support for 1s-based allocation :::::: TO: Matthew Wilcox <willy@xxxxxxxxxxxxx> :::::: CC: Matthew Wilcox <willy@xxxxxxxxxxxxx> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki