[linux-stable-rc:linux-4.4.y 9983/9999] mm/page_alloc.c:2024:2: warning: ISO C90 forbids mixed declarations and code

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
head:   56cfa226aa2348915cd4ced0b72542dc35ca2467
commit: df82285ab4b974f2040f31dbabdd11e055a282c2 [9983/9999] mm, meminit: recalculate pcpu batch and high limits after init completes
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        git checkout df82285ab4b974f2040f31dbabdd11e055a282c2
        # save the attached .config to linux build tree
        make ARCH=i386 

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

All warnings (new ones prefixed by >>):

   mm/page_alloc.c: In function 'drain_all_pages':
>> mm/page_alloc.c:2024:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     static cpumask_t cpus_with_pcps;
     ^~~~~~

vim +2024 mm/page_alloc.c

9f8f2172537de7 Christoph Lameter 2008-02-04  1996  
9f8f2172537de7 Christoph Lameter 2008-02-04  1997  /*
74046494ea6867 Gilad Ben-Yossef  2012-03-28  1998   * Spill all the per-cpu pages from all CPUs back into the buddy allocator.
74046494ea6867 Gilad Ben-Yossef  2012-03-28  1999   *
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2000   * When zone parameter is non-NULL, spill just the single zone's pages.
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2001   *
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2002   * Note that this code is protected against sending an IPI to an offline
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2003   * CPU but does not guarantee sending an IPI to newly hotplugged CPUs:
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2004   * on_each_cpu_mask() blocks hotplug and won't talk to offlined CPUs but
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2005   * nothing keeps CPUs from showing up after we populated the cpumask and
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2006   * before the call to on_each_cpu_mask().
9f8f2172537de7 Christoph Lameter 2008-02-04  2007   */
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2008  void drain_all_pages(struct zone *zone)
9f8f2172537de7 Christoph Lameter 2008-02-04  2009  {
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2010  	int cpu;
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2011  
df82285ab4b974 Mel Gorman        2019-11-05  2012  	/*
df82285ab4b974 Mel Gorman        2019-11-05  2013  	 * The number of managed pages has changed due to the initialisation
df82285ab4b974 Mel Gorman        2019-11-05  2014  	 * so the pcpu batch and high limits needs to be updated or the limits
df82285ab4b974 Mel Gorman        2019-11-05  2015  	 * will be artificially small.
df82285ab4b974 Mel Gorman        2019-11-05  2016  	 */
df82285ab4b974 Mel Gorman        2019-11-05  2017  	for_each_populated_zone(zone)
df82285ab4b974 Mel Gorman        2019-11-05  2018  		zone_pcp_update(zone);
df82285ab4b974 Mel Gorman        2019-11-05  2019  
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2020  	/*
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2021  	 * Allocate in the BSS so we wont require allocation in
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2022  	 * direct reclaim path for CONFIG_CPUMASK_OFFSTACK=y
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2023  	 */
74046494ea6867 Gilad Ben-Yossef  2012-03-28 @2024  	static cpumask_t cpus_with_pcps;
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2025  
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2026  	/*
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2027  	 * We don't care about racing with CPU hotplug event
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2028  	 * as offline notification will cause the notified
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2029  	 * cpu to drain that CPU pcps and on_each_cpu_mask
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2030  	 * disables preemption as part of its processing
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2031  	 */
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2032  	for_each_online_cpu(cpu) {
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2033  		struct per_cpu_pageset *pcp;
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2034  		struct zone *z;
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2035  		bool has_pcps = false;
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2036  
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2037  		if (zone) {
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2038  			pcp = per_cpu_ptr(zone->pageset, cpu);
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2039  			if (pcp->pcp.count)
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2040  				has_pcps = true;
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2041  		} else {
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2042  			for_each_populated_zone(z) {
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2043  				pcp = per_cpu_ptr(z->pageset, cpu);
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2044  				if (pcp->pcp.count) {
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2045  					has_pcps = true;
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2046  					break;
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2047  				}
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2048  			}
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2049  		}
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2050  
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2051  		if (has_pcps)
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2052  			cpumask_set_cpu(cpu, &cpus_with_pcps);
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2053  		else
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2054  			cpumask_clear_cpu(cpu, &cpus_with_pcps);
74046494ea6867 Gilad Ben-Yossef  2012-03-28  2055  	}
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2056  	on_each_cpu_mask(&cpus_with_pcps, (smp_call_func_t) drain_local_pages,
93481ff0e5a0c7 Vlastimil Babka   2014-12-10  2057  								zone, 1);
9f8f2172537de7 Christoph Lameter 2008-02-04  2058  }
9f8f2172537de7 Christoph Lameter 2008-02-04  2059  

:::::: The code at line 2024 was first introduced by commit
:::::: 74046494ea68676d29ef6501a4bd950f08112a2c mm: only IPI CPUs to drain local pages if they exist

:::::: TO: Gilad Ben-Yossef <gilad@xxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx 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