Re: [PATCH v7 1/4] sgl_alloc_order: remove 4 GiB limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Douglas,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.17-rc2 next-20220131]
[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/0day-ci/linux/commits/Douglas-Gilbert/scatterlist-add-new-capabilities/20220201-115047
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 26291c54e111ff6ba87a164d85d4a4e134b7315c
config: i386-randconfig-a003-20220131 (https://download.01.org/0day-ci/archive/20220201/202202012125.JGVcLupw-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/be1e80a043970c400c00709be739ab26f931331a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Douglas-Gilbert/scatterlist-add-new-capabilities/20220201-115047
        git checkout be1e80a043970c400c00709be739ab26f931331a
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   ld: lib/scatterlist.o: in function `sgl_alloc_order':
>> lib/scatterlist.c:612: undefined reference to `__udivdi3'


vim +612 lib/scatterlist.c

   586	
   587	/**
   588	 * sgl_alloc_order - allocate a scatterlist with equally sized elements each
   589	 *		     of which has 2^@order continuous pages
   590	 * @length: Length in bytes of the scatterlist. Must be at least one
   591	 * @order:  Second argument for alloc_pages(). Each sgl element size will
   592	 *	    be (PAGE_SIZE*2^@order) bytes. @order must not exceed 16.
   593	 * @chainable: Whether or not to allocate an extra element in the scatterlist
   594	 *	       for scatterlist chaining purposes
   595	 * @gfp: Memory allocation flags
   596	 * @nent_p: [out] Number of entries in the scatterlist that have pages.
   597	 *		  Ignored if @nent_p is NULL.
   598	 *
   599	 * Returns: A pointer to an initialized scatterlist or %NULL upon failure.
   600	 */
   601	struct scatterlist *sgl_alloc_order(unsigned long long length,
   602					    unsigned int order, bool chainable,
   603					    gfp_t gfp, unsigned int *nent_p)
   604	{
   605		struct scatterlist *sgl, *sg;
   606		struct page *page;
   607		unsigned int nent, nalloc;
   608		u32 elem_len;
   609	
   610		if (length >> (PAGE_SHIFT + order) >= UINT_MAX)
   611			return NULL;
 > 612		nent = DIV_ROUND_UP(length, PAGE_SIZE << order);
   613	
   614		if (chainable) {
   615			if (check_add_overflow(nent, 1U, &nalloc))
   616				return NULL;
   617		} else {
   618			nalloc = nent;
   619		}
   620		sgl = kmalloc_array(nalloc, sizeof(struct scatterlist),
   621				    gfp & ~GFP_DMA);
   622		if (!sgl)
   623			return NULL;
   624	
   625		sg_init_table(sgl, nalloc);
   626		sg = sgl;
   627		while (length) {
   628			elem_len = min_t(u64, length, PAGE_SIZE << order);
   629			page = alloc_pages(gfp, order);
   630			if (!page) {
   631				sgl_free_order(sgl, order);
   632				return NULL;
   633			}
   634	
   635			sg_set_page(sg, page, elem_len, 0);
   636			length -= elem_len;
   637			sg = sg_next(sg);
   638		}
   639		WARN_ONCE(length, "length = %lld\n", length);
   640		if (nent_p)
   641			*nent_p = nent;
   642		return sgl;
   643	}
   644	EXPORT_SYMBOL(sgl_alloc_order);
   645	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux