On Thu, Nov 27, 2014 at 08:18:37AM +0800, kbuild test robot wrote: > tree: git://git.cmpxchg.org/linux-mmotm.git master > head: a2d887dee78e23dc092ff14ae2ad22592437a328 > commit: 7eba9427dd923bdf1cc5f88bb0fb880fe1268be0 [174/397] mm: support madvise(MADV_FREE) > config: xtensa-common_defconfig (attached as .config) > reproduce: > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > git checkout 7eba9427dd923bdf1cc5f88bb0fb880fe1268be0 > # save the attached .config to linux build tree > make.cross ARCH=xtensa > > All error/warnings: > > mm/madvise.c: In function 'madvise_need_mmap_write': > >> mm/madvise.c:42:7: error: 'MADV_FREE' undeclared (first use in this function) > case MADV_FREE: > ^ > mm/madvise.c:42:7: note: each undeclared identifier is reported only once for each function it appears in > mm/madvise.c: In function 'madvise_vma': > >> mm/madvise.c:515:7: error: 'MADV_FREE' undeclared (first use in this function) > case MADV_FREE: > ^ > mm/madvise.c: In function 'madvise_behavior_valid': > >> mm/madvise.c:542:7: error: 'MADV_FREE' undeclared (first use in this function) > case MADV_FREE: > ^ > > vim +/MADV_FREE +42 mm/madvise.c > > 36 static int madvise_need_mmap_write(int behavior) > 37 { > 38 switch (behavior) { > 39 case MADV_REMOVE: > 40 case MADV_WILLNEED: > 41 case MADV_DONTNEED: > > 42 case MADV_FREE: > 43 return 0; > 44 default: > 45 /* be safe, default to 1. list exceptions explicitly */ > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > http://lists.01.org/mailman/listinfo/kbuild Intel Corporation Thanks. Below should fix the problem. >From 5ca29f2f9ed96d1a0c9ac4209696839dcf5f0e49 Mon Sep 17 00:00:00 2001 From: Minchan Kim <minchan@xxxxxxxxxx> Date: Thu, 27 Nov 2014 10:02:00 +0900 Subject: [PATCH] mm: define MADV_FREE for some arches Most architectures use asm-generic, but alpha, mips, parisc, xtensa need their own definitions. This patch defines MADV_FREE for them so it should fix build break for their architectures. Maybe, I should split and feed piecies to arch maintainers but included here for mmotm convenience. Cc: Michael Kerrisk <mtk.manpages@xxxxxxxxx> Cc: Richard Henderson <rth@xxxxxxxxxxx> Cc: Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx> Cc: "James E.J. Bottomley" <jejb@xxxxxxxxxxxxxxxx> Cc: Helge Deller <deller@xxxxxx> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Cc: Chris Zankel <chris@xxxxxxxxxx> Cc: Max Filippov <jcmvbkbc@xxxxxxxxx> Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx> Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx> --- arch/alpha/include/uapi/asm/mman.h | 1 + arch/mips/include/uapi/asm/mman.h | 1 + arch/parisc/include/uapi/asm/mman.h | 1 + arch/xtensa/include/uapi/asm/mman.h | 1 + 4 files changed, 4 insertions(+) diff --git a/arch/alpha/include/uapi/asm/mman.h b/arch/alpha/include/uapi/asm/mman.h index 0086b472bc2b..836fbd44f65b 100644 --- a/arch/alpha/include/uapi/asm/mman.h +++ b/arch/alpha/include/uapi/asm/mman.h @@ -44,6 +44,7 @@ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_SPACEAVAIL 5 /* ensure resources are available */ #define MADV_DONTNEED 6 /* don't need these pages */ +#define MADV_FREE 7 /* free pages only if memory pressure */ /* common/generic parameters */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/arch/mips/include/uapi/asm/mman.h b/arch/mips/include/uapi/asm/mman.h index cfcb876cae6b..106e741aa7ee 100644 --- a/arch/mips/include/uapi/asm/mman.h +++ b/arch/mips/include/uapi/asm/mman.h @@ -67,6 +67,7 @@ #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* don't need these pages */ +#define MADV_FREE 5 /* free pages only if memory pressure */ /* common parameters: try to keep these consistent across architectures */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h index 294d251ca7b2..6cb8db76fd4e 100644 --- a/arch/parisc/include/uapi/asm/mman.h +++ b/arch/parisc/include/uapi/asm/mman.h @@ -40,6 +40,7 @@ #define MADV_SPACEAVAIL 5 /* insure that resources are reserved */ #define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */ #define MADV_VPS_INHERIT 7 /* Inherit parents page size */ +#define MADV_FREE 8 /* free pages only if memory pressure */ /* common/generic parameters */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/arch/xtensa/include/uapi/asm/mman.h b/arch/xtensa/include/uapi/asm/mman.h index 201aec0e0446..1b19f25bc567 100644 --- a/arch/xtensa/include/uapi/asm/mman.h +++ b/arch/xtensa/include/uapi/asm/mman.h @@ -80,6 +80,7 @@ #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* don't need these pages */ +#define MADV_FREE 5 /* free pages only if memory pressure */ /* common parameters: try to keep these consistent across architectures */ #define MADV_REMOVE 9 /* remove these pages & resources */ -- 2.0.0 -- Kind regards, Minchan Kim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>