Re: [PATCH] mm: fix low-high watermark distance on small systems

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

 



Hi Vinayak,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v4.16-rc4]
[also build test ERROR on next-20180316]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vinayak-Menon/mm-fix-low-high-watermark-distance-on-small-systems/20180317-073051
config: i386-randconfig-a0-201810 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   mm/page_alloc.o: In function `__setup_per_zone_wmarks':
>> mm/page_alloc.c:7061: undefined reference to `__udivdi3'
>> mm/page_alloc.c:7061: undefined reference to `__umoddi3'
>> mm/page_alloc.c:7061: undefined reference to `__udivdi3'

vim +7061 mm/page_alloc.c

  6999	
  7000	static void __setup_per_zone_wmarks(void)
  7001	{
  7002		unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
  7003		unsigned long lowmem_pages = 0;
  7004		struct zone *zone;
  7005		unsigned long flags;
  7006	
  7007		/* Calculate total number of !ZONE_HIGHMEM pages */
  7008		for_each_zone(zone) {
  7009			if (!is_highmem(zone))
  7010				lowmem_pages += zone->managed_pages;
  7011		}
  7012	
  7013		for_each_zone(zone) {
  7014			u64 tmp;
  7015	
  7016			spin_lock_irqsave(&zone->lock, flags);
  7017			tmp = (u64)pages_min * zone->managed_pages;
  7018			do_div(tmp, lowmem_pages);
  7019			if (is_highmem(zone)) {
  7020				/*
  7021				 * __GFP_HIGH and PF_MEMALLOC allocations usually don't
  7022				 * need highmem pages, so cap pages_min to a small
  7023				 * value here.
  7024				 *
  7025				 * The WMARK_HIGH-WMARK_LOW and (WMARK_LOW-WMARK_MIN)
  7026				 * deltas control asynch page reclaim, and so should
  7027				 * not be capped for highmem.
  7028				 */
  7029				unsigned long min_pages;
  7030	
  7031				min_pages = zone->managed_pages / 1024;
  7032				min_pages = clamp(min_pages, SWAP_CLUSTER_MAX, 128UL);
  7033				zone->watermark[WMARK_MIN] = min_pages;
  7034			} else {
  7035				/*
  7036				 * If it's a lowmem zone, reserve a number of pages
  7037				 * proportionate to the zone's size.
  7038				 */
  7039				zone->watermark[WMARK_MIN] = tmp;
  7040			}
  7041	
  7042			/*
  7043			 * Set the kswapd watermarks distance according to the
  7044			 * scale factor in proportion to available memory, but
  7045			 * ensure a minimum size on small systems.
  7046			 */
  7047			tmp = max_t(u64, tmp >> 2,
  7048				    mult_frac(zone->managed_pages,
  7049					      watermark_scale_factor, 10000));
  7050	
  7051			zone->watermark[WMARK_LOW]  = min_wmark_pages(zone) + tmp;
  7052	
  7053			/*
  7054			 * Set the kswapd low-high distance as a percentage of
  7055			 * min-low distance in such a way that the distance
  7056			 * increases non-linearly with available memory. This
  7057			 * ensures enough free memory without causing thrashing
  7058			 * on small machines due to excessive reclaim by kswapd.
  7059			 * Ensure a minimum distance on very small machines.
  7060			 */
> 7061			tmp = clamp_t(u64, mult_frac(tmp,
  7062					int_sqrt(4 * zone->managed_pages), 10000),
  7063						min_wmark_pages(zone) >> 2, tmp);
  7064	
  7065			zone->watermark[WMARK_HIGH] = low_wmark_pages(zone) + tmp;
  7066	
  7067			spin_unlock_irqrestore(&zone->lock, flags);
  7068		}
  7069	
  7070		/* update totalreserve_pages */
  7071		calculate_totalreserve_pages();
  7072	}
  7073	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux