lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202041807.DLd23Ex7-lkp@intel.com>
Date:   Fri, 4 Feb 2022 18:31:40 +0800
From:   kernel test robot <lkp@...el.com>
To:     Nicolas Saenz Julienne <nsaenzju@...hat.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [nsaenz-rpi:pcplists-rcu-drain-v1 1/2] mm/page_alloc.c:1481:30:
 sparse: sparse: incorrect type in assignment (different modifiers)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git pcplists-rcu-drain-v1
head:   01b58921eae8d67b3ad6b05e73c2a1dd7106ae28
commit: eb4d0c9ef79083312513bfbbf26d6ef7defcc6b3 [1/2] mm/page_alloc: Access lists in 'struct per_cpu_pages' indirectly
config: h8300-randconfig-s032-20220201 (https://download.01.org/0day-ci/archive/20220204/202202041807.DLd23Ex7-lkp@intel.com/config)
compiler: h8300-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git/commit/?id=eb4d0c9ef79083312513bfbbf26d6ef7defcc6b3
        git remote add nsaenz-rpi https://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git
        git fetch --no-tags nsaenz-rpi pcplists-rcu-drain-v1
        git checkout eb4d0c9ef79083312513bfbbf26d6ef7defcc6b3
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=h8300 SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/page_alloc.c:1481:30: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct list_head *list @@     got struct list_head [noderef] * @@
   mm/page_alloc.c:1481:30: sparse:     expected struct list_head *list
   mm/page_alloc.c:1481:30: sparse:     got struct list_head [noderef] *
>> mm/page_alloc.c:3442:40: sparse: sparse: incorrect type in argument 2 (different modifiers) @@     expected struct list_head *head @@     got struct list_head [noderef] * @@
   mm/page_alloc.c:3442:40: sparse:     expected struct list_head *head
   mm/page_alloc.c:3442:40: sparse:     got struct list_head [noderef] *
   mm/page_alloc.c:3733:14: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct list_head *list @@     got struct list_head [noderef] * @@
   mm/page_alloc.c:3733:14: sparse:     expected struct list_head *list
   mm/page_alloc.c:3733:14: sparse:     got struct list_head [noderef] *
>> mm/page_alloc.c:3734:15: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected int *count @@     got int [noderef] * @@
   mm/page_alloc.c:3734:15: sparse:     expected int *count
   mm/page_alloc.c:3734:15: sparse:     got int [noderef] *
>> mm/page_alloc.c:5356:18: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct list_head *pcp_list @@     got struct list_head [noderef] * @@
   mm/page_alloc.c:5356:18: sparse:     expected struct list_head *pcp_list
   mm/page_alloc.c:5356:18: sparse:     got struct list_head [noderef] *
   mm/page_alloc.c:5357:15: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected int *count @@     got int [noderef] * @@
   mm/page_alloc.c:5357:15: sparse:     expected int *count
   mm/page_alloc.c:5357:15: sparse:     got int [noderef] *
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
   mm/page_alloc.c:6068:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct per_cpu_pages [noderef] __percpu ** @@
   mm/page_alloc.c:6068:17: sparse:     expected void const [noderef] __percpu *__vpp_verify
   mm/page_alloc.c:6068:17: sparse:     got struct per_cpu_pages [noderef] __percpu **
>> mm/page_alloc.c:7022:47: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head *list @@     got struct list_head [noderef] * @@
   mm/page_alloc.c:7022:47: sparse:     expected struct list_head *list
   mm/page_alloc.c:7022:47: sparse:     got struct list_head [noderef] *
>> mm/page_alloc.c:1466:17: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:1521:9: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:3163:13: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:3164:42: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:3277:29: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:3282:37: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:3443:9: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:3445:13: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c: note: in included file (through include/linux/mm.h):
   include/linux/gfp.h:368:27: sparse: sparse: restricted gfp_t degrades to integer
   include/linux/gfp.h:368:27: sparse: sparse: restricted gfp_t degrades to integer
   mm/page_alloc.c:5971:76: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:6065:76: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:6068:17: sparse: sparse: dereference of noderef expression
   mm/page_alloc.c:6068:17: sparse: sparse: dereference of noderef expression

vim +1481 mm/page_alloc.c

  1445	
  1446	/*
  1447	 * Frees a number of pages from the PCP lists
  1448	 * Assumes all pages on list are in same zone.
  1449	 * count is the number of pages to free.
  1450	 */
  1451	static void free_pcppages_bulk(struct zone *zone, int count,
  1452				       int batch, struct pcplists *lp)
  1453	{
  1454		int pindex = 0;
  1455		int batch_free = 0;
  1456		int nr_freed = 0;
  1457		unsigned int order;
  1458		bool isolated_pageblocks;
  1459		struct page *page, *tmp;
  1460		LIST_HEAD(head);
  1461	
  1462		/*
  1463		 * Ensure proper count is passed which otherwise would stuck in the
  1464		 * below while (list_empty(list)) loop.
  1465		 */
> 1466		count = min(lp->count, count);
  1467		while (count > 0) {
  1468			struct list_head *list;
  1469	
  1470			/*
  1471			 * Remove pages from lists in a round-robin fashion. A
  1472			 * batch_free count is maintained that is incremented when an
  1473			 * empty list is encountered.  This is so more pages are freed
  1474			 * off fuller lists instead of spinning excessively around empty
  1475			 * lists
  1476			 */
  1477			do {
  1478				batch_free++;
  1479				if (++pindex == NR_PCP_LISTS)
  1480					pindex = 0;
> 1481				list = &lp->lists[pindex];
  1482			} while (list_empty(list));
  1483	
  1484			/* This is the only non-empty list. Free them all. */
  1485			if (batch_free == NR_PCP_LISTS)
  1486				batch_free = count;
  1487	
  1488			order = pindex_to_order(pindex);
  1489			BUILD_BUG_ON(MAX_ORDER >= (1<<NR_PCP_ORDER_WIDTH));
  1490			do {
  1491				page = list_last_entry(list, struct page, lru);
  1492				/* must delete to avoid corrupting pcp list */
  1493				list_del(&page->lru);
  1494				nr_freed += 1 << order;
  1495				count -= 1 << order;
  1496	
  1497				if (bulkfree_pcp_prepare(page))
  1498					continue;
  1499	
  1500				/* Encode order with the migratetype */
  1501				page->index <<= NR_PCP_ORDER_WIDTH;
  1502				page->index |= order;
  1503	
  1504				list_add_tail(&page->lru, &head);
  1505	
  1506				/*
  1507				 * We are going to put the page back to the global
  1508				 * pool, prefetch its buddy to speed up later access
  1509				 * under zone->lock. It is believed the overhead of
  1510				 * an additional test and calculating buddy_pfn here
  1511				 * can be offset by reduced memory latency later. To
  1512				 * avoid excessive prefetching due to large count, only
  1513				 * prefetch buddy for the first pcp->batch nr of pages.
  1514				 */
  1515				if (batch) {
  1516					prefetch_buddy(page);
  1517					batch--;
  1518				}
  1519			} while (count > 0 && --batch_free && !list_empty(list));
  1520		}
  1521		lp->count -= nr_freed;
  1522	
  1523		/*
  1524		 * local_lock_irq held so equivalent to spin_lock_irqsave for
  1525		 * both PREEMPT_RT and non-PREEMPT_RT configurations.
  1526		 */
  1527		spin_lock(&zone->lock);
  1528		isolated_pageblocks = has_isolate_pageblock(zone);
  1529	
  1530		/*
  1531		 * Use safe version since after __free_one_page(),
  1532		 * page->lru.next will not point to original list.
  1533		 */
  1534		list_for_each_entry_safe(page, tmp, &head, lru) {
  1535			int mt = get_pcppage_migratetype(page);
  1536	
  1537			/* mt has been encoded with the order (see above) */
  1538			order = mt & NR_PCP_ORDER_MASK;
  1539			mt >>= NR_PCP_ORDER_WIDTH;
  1540	
  1541			/* MIGRATE_ISOLATE page should not go to pcplists */
  1542			VM_BUG_ON_PAGE(is_migrate_isolate(mt), page);
  1543			/* Pageblock could have been isolated meanwhile */
  1544			if (unlikely(isolated_pageblocks))
  1545				mt = get_pageblock_migratetype(page);
  1546	
  1547			__free_one_page(page, page_to_pfn(page), zone, order, mt, FPI_NONE);
  1548			trace_mm_page_pcpu_drain(page, order, mt);
  1549		}
  1550		spin_unlock(&zone->lock);
  1551	}
  1552	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ