Re: [PATCH v4 2/2] xen: add helpers to allocate unpopulated memory

From: kernel test robot
Date: Wed Aug 12 2020 - 14:14:17 EST


Hi Roger,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on xen-tip/linux-next]
[also build test ERROR on linux/master hnaz-linux-mm/master linus/master v5.8 next-20200812]
[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/Roger-Pau-Monne/xen-balloon-fixes-for-memory-hotplug/20200811-174616
base: https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next
config: x86_64-randconfig-a001-20200812 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 30c1633386e7cfb01c0a54b31ccf4c3a3873e71b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

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

All errors (new ones prefixed by >>):

In file included from drivers/xen/grant-table.c:59:
include/xen/balloon.h:8:8: error: redefinition of 'balloon_stats'
struct balloon_stats {
^
include/xen/xen.h:61:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
drivers/xen/grant-table.c:59:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
include/xen/balloon.h:8:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct balloon_stats {
^
In file included from drivers/xen/grant-table.c:59:
>> include/xen/balloon.h:33:20: error: redefinition of 'xen_balloon_init'
static inline void xen_balloon_init(void)
^
include/xen/balloon.h:33:20: note: previous definition is here
static inline void xen_balloon_init(void)
^
2 errors generated.
--
In file included from drivers/xen/balloon.c:70:
include/xen/balloon.h:8:8: error: redefinition of 'balloon_stats'
struct balloon_stats {
^
include/xen/xen.h:61:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
drivers/xen/balloon.c:70:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
include/xen/balloon.h:8:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct balloon_stats {
^
In file included from drivers/xen/balloon.c:70:
>> include/xen/balloon.h:33:20: error: redefinition of 'xen_balloon_init'
static inline void xen_balloon_init(void)
^
include/xen/balloon.h:33:20: note: previous definition is here
static inline void xen_balloon_init(void)
^
2 errors generated.
--
In file included from drivers/xen/gntdev.c:41:
include/xen/balloon.h:8:8: error: redefinition of 'balloon_stats'
struct balloon_stats {
^
include/xen/xen.h:61:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
drivers/xen/gntdev.c:41:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
include/xen/balloon.h:8:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct balloon_stats {
^
In file included from drivers/xen/gntdev.c:41:
>> include/xen/balloon.h:33:20: error: redefinition of 'xen_balloon_init'
static inline void xen_balloon_init(void)
^
include/xen/balloon.h:33:20: note: previous definition is here
static inline void xen_balloon_init(void)
^
In file included from drivers/xen/gntdev.c:48:
In file included from drivers/xen/gntdev-common.h:15:
include/linux/mman.h:134:9: warning: division by zero is undefined [-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:111:21: note: expanded from macro '_calc_vm_trans'
: ((x) & (bit1)) / ((bit1) / (bit2))))
^ ~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
--
In file included from drivers/xen/privcmd.c:40:
include/xen/balloon.h:8:8: error: redefinition of 'balloon_stats'
struct balloon_stats {
^
include/xen/xen.h:61:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
drivers/xen/privcmd.c:40:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
include/xen/balloon.h:8:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct balloon_stats {
^
In file included from drivers/xen/privcmd.c:40:
>> include/xen/balloon.h:33:20: error: redefinition of 'xen_balloon_init'
static inline void xen_balloon_init(void)
^
include/xen/balloon.h:33:20: note: previous definition is here
static inline void xen_balloon_init(void)
^
2 errors generated.
--
In file included from drivers/xen/xlate_mmu.c:43:
include/xen/balloon.h:8:8: error: redefinition of 'balloon_stats'
struct balloon_stats {
^
include/xen/xen.h:61:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
drivers/xen/xlate_mmu.c:43:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
include/xen/balloon.h:8:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct balloon_stats {
^
In file included from drivers/xen/xlate_mmu.c:43:
>> include/xen/balloon.h:33:20: error: redefinition of 'xen_balloon_init'
static inline void xen_balloon_init(void)
^
include/xen/balloon.h:33:20: note: previous definition is here
static inline void xen_balloon_init(void)
^
2 errors generated.
--
In file included from drivers/xen/xenbus/xenbus_client.c:44:
In file included from include/xen/events.h:13:
In file included from arch/x86/include/asm/xen/events.h:5:
In file included from include/xen/xen.h:61:
include/xen/balloon.h:8:8: error: redefinition of 'balloon_stats'
struct balloon_stats {
^
drivers/xen/xenbus/xenbus_client.c:43:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
include/xen/xen.h:61:10: note: 'include/xen/balloon.h' included multiple times, additional include site here
#include <xen/balloon.h>
^
include/xen/balloon.h:8:8: note: unguarded header; consider using #ifdef guards or #pragma once
struct balloon_stats {
^
In file included from drivers/xen/xenbus/xenbus_client.c:44:
In file included from include/xen/events.h:13:
In file included from arch/x86/include/asm/xen/events.h:5:
In file included from include/xen/xen.h:61:
>> include/xen/balloon.h:33:20: error: redefinition of 'xen_balloon_init'
static inline void xen_balloon_init(void)
^
include/xen/balloon.h:33:20: note: previous definition is here
static inline void xen_balloon_init(void)
^
2 errors generated.

vim +/xen_balloon_init +33 include/xen/balloon.h

803eb047a28d239 Daniel De Graaf 2011-03-14 7
803eb047a28d239 Daniel De Graaf 2011-03-14 @8 struct balloon_stats {
803eb047a28d239 Daniel De Graaf 2011-03-14 9 /* We aim for 'current allocation' == 'target allocation'. */
803eb047a28d239 Daniel De Graaf 2011-03-14 10 unsigned long current_pages;
803eb047a28d239 Daniel De Graaf 2011-03-14 11 unsigned long target_pages;
1cf6a6c82918c9a David Vrabel 2015-06-25 12 unsigned long target_unpopulated;
803eb047a28d239 Daniel De Graaf 2011-03-14 13 /* Number of pages in high- and low-memory balloons. */
803eb047a28d239 Daniel De Graaf 2011-03-14 14 unsigned long balloon_low;
803eb047a28d239 Daniel De Graaf 2011-03-14 15 unsigned long balloon_high;
de5a77d8422fc7e David Vrabel 2015-06-25 16 unsigned long total_pages;
803eb047a28d239 Daniel De Graaf 2011-03-14 17 unsigned long schedule_delay;
803eb047a28d239 Daniel De Graaf 2011-03-14 18 unsigned long max_schedule_delay;
803eb047a28d239 Daniel De Graaf 2011-03-14 19 unsigned long retry_count;
803eb047a28d239 Daniel De Graaf 2011-03-14 20 unsigned long max_retry_count;
803eb047a28d239 Daniel De Graaf 2011-03-14 21 };
803eb047a28d239 Daniel De Graaf 2011-03-14 22
803eb047a28d239 Daniel De Graaf 2011-03-14 23 extern struct balloon_stats balloon_stats;
803eb047a28d239 Daniel De Graaf 2011-03-14 24
803eb047a28d239 Daniel De Graaf 2011-03-14 25 void balloon_set_new_target(unsigned long target);
b6f3067985f12d5 Konrad Rzeszutek Wilk 2011-03-15 26
81b286e0f1fe520 David Vrabel 2015-06-25 27 int alloc_xenballooned_pages(int nr_pages, struct page **pages);
b6f3067985f12d5 Konrad Rzeszutek Wilk 2011-03-15 28 void free_xenballooned_pages(int nr_pages, struct page **pages);
a50777c791031d7 Dan Magenheimer 2011-07-08 29
96edd61dcf44362 Juergen Gross 2017-07-10 30 #ifdef CONFIG_XEN_BALLOON
96edd61dcf44362 Juergen Gross 2017-07-10 31 void xen_balloon_init(void);
96edd61dcf44362 Juergen Gross 2017-07-10 32 #else
96edd61dcf44362 Juergen Gross 2017-07-10 @33 static inline void xen_balloon_init(void)

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

Attachment: .config.gz
Description: application/gzip