Skip to contentSkip to conversation

fs/xfs/xfs_zone_gc.c:186: undefined reference to `__divmoddi4'

DISCUSSION kernel test robot 2 participants 2 messages Apr 18, 2025 – Apr 19, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc96b232f8e7c0a6c282f47726b2ff6a5fb341d2
commit: 845abeb1f06a8a44e21314460eeb14cddfca52cc xfs: add tunable threshold parameter for triggering zone GC
date:   4 days ago
config: i386-buildonly-randconfig-004-20250418 (https://download.01.org/0day-ci/archive/20250418/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250418/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

ld: fs/xfs/xfs_zone_gc.o: in function `xfs_zoned_need_gc':

>> fs/xfs/xfs_zone_gc.c:186: undefined reference to `__divmoddi4'
>> ld: fs/xfs/xfs_zone_gc.c:186: undefined reference to `__divdi3'

vim +186 fs/xfs/xfs_zone_gc.c

162
163 /*
164 * We aim to keep enough zones free in stock to fully use the open zone limit
165 * for data placement purposes. Additionally, the m_zonegc_low_space tunable
166 * can be set to make sure a fraction of the unused blocks are available for
167 * writing.
168 */
169 bool
170 xfs_zoned_need_gc(
171 struct xfs_mount *mp)
172 {
173 s64 available, free;
174
175 if (!xfs_group_marked(mp, XG_TYPE_RTG, XFS_RTG_RECLAIMABLE))
176 return false;
177
178 available = xfs_estimate_freecounter(mp, XC_FREE_RTAVAILABLE);
179
180 if (available <
181 mp->m_groups[XG_TYPE_RTG].blocks *
182 (mp->m_max_open_zones - XFS_OPEN_GC_ZONES))
183 return true;
184
185 free = xfs_estimate_freecounter(mp, XC_FREE_RTEXTENTS);

 > 186		if (available < mult_frac(free, mp->m_zonegc_low_space, 100))

187 return true;
188
189 return false;
190 }
191

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 8 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc96b232f8e7c0a6c282f47726b2ff6a5fb341d2
commit: 845abeb1f06a8a44e21314460eeb14cddfca52cc xfs: add tunable threshold parameter for triggering zone GC
date:   4 days ago
config: i386-buildonly-randconfig-004-20250418 (https://download.01.org/0day-ci/archive/20250418/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250418/[email protected]/reproduce)
Quoted 10 lines

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

ld: fs/xfs/xfs_zone_gc.o: in function `xfs_zoned_need_gc':

Quoted 2 lines
Quoted 2 lines

fs/xfs/xfs_zone_gc.c:186: undefined reference to `__divmoddi4'
ld: fs/xfs/xfs_zone_gc.c:186: undefined reference to `__divdi3'

I don't think there is anything xfs can do here, this likely requires to be fixed on math.h and make mult_frac be properly built on i386. I'm testing a patch here and will submit it at least to start a discussion.

Quoted 38 lines

vim +186 fs/xfs/xfs_zone_gc.c

   162
   163	/*
   164	 * We aim to keep enough zones free in stock to fully use the open zone limit
   165	 * for data placement purposes. Additionally, the m_zonegc_low_space tunable
   166	 * can be set to make sure a fraction of the unused blocks are available for
   167	 * writing.
   168	 */
   169	bool
   170	xfs_zoned_need_gc(
   171		struct xfs_mount	*mp)
   172	{
   173		s64			available, free;
   174
   175		if (!xfs_group_marked(mp, XG_TYPE_RTG, XFS_RTG_RECLAIMABLE))
   176			return false;
   177
   178		available = xfs_estimate_freecounter(mp, XC_FREE_RTAVAILABLE);
   179
   180		if (available <
   181		    mp->m_groups[XG_TYPE_RTG].blocks *
   182		    (mp->m_max_open_zones - XFS_OPEN_GC_ZONES))
   183			return true;
   184
   185		free = xfs_estimate_freecounter(mp, XC_FREE_RTEXTENTS);
Quoted 1 line

186 if (available < mult_frac(free, mp->m_zonegc_low_space, 100))

   187			return true;
   188
   189		return false;
   190	}
   191

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