[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-yev9rexu02cl7cjeozzmrl9t@git.kernel.org>
Date: Fri, 22 Sep 2017 09:45:23 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: wangnan0@...wei.com, namhyung@...nel.org, adrian.hunter@...el.com,
tglx@...utronix.de, jolsa@...nel.org, hpa@...or.com,
acme@...hat.com, mingo@...nel.org, mike.kravetz@...cle.com,
dsahern@...il.com, riel@...hat.com, linux-kernel@...r.kernel.org
Subject: [tip:perf/core] tools: Update asm-generic/mman-common.h copy from
the kernel
Commit-ID: 492e05b0654126bd6a04473028ac4c8cfc22ccec
Gitweb: http://git.kernel.org/tip/492e05b0654126bd6a04473028ac4c8cfc22ccec
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Wed, 20 Sep 2017 12:41:57 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 21 Sep 2017 13:12:59 -0300
tools: Update asm-generic/mman-common.h copy from the kernel
To get the defines introduced in the commit aafd4562dfee ("mm: arch:
consolidate mmap hugetlb size encodings"), that doesn't brings anything
interesting for tools/, but also the ones from d2cd9ede6e19 ("mm,fork:
introduce MADV_WIPEONFORK"), which does, and ends up triggering an auto-update
to the tools/perf/trace/beauty/generated/madvise_behavior_array.c file,
supporting the newly introduced 'behavior' values.
This silences this perf build warning:
Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman-common.h' differs from latest version at 'include/uapi/asm-generic/mman-common.h'
Testing it:
# cat madvise.c
#include <sys/mman.h>
#include <stdlib.h>
#ifndef MADV_WIPEONFORK
#define MADV_WIPEONFORK 18
#endif
#ifndef MADV_KEEPONFORK
#define MADV_KEEPONFORK 19
#endif
int main(void)
{
void *ptr = mmap(NULL, 4096, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
madvise(ptr, 4096, MADV_WIPEONFORK);
madvise(ptr, 4096, MADV_KEEPONFORK);
return 0;
}
[root@...et c]# perf trace -e mmap,madvise ./madvise
0.000 ( 0.013 ms): madvise/11732 mmap(len: 8192, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS ) = 0x7fba6e015000
0.047 ( 0.004 ms): madvise/11732 mmap(len: 160164, prot: READ, flags: PRIVATE, fd: 3 ) = 0x7fba6dfed000
0.084 ( 0.009 ms): madvise/11732 mmap(len: 4000096, prot: EXEC|READ, flags: PRIVATE|DENYWRITE, fd: 3 ) = 0x7fba6da20000
0.109 ( 0.006 ms): madvise/11732 mmap(addr: 0x7fba6dde7000, len: 24576, prot: READ|WRITE, flags: PRIVATE|DENYWRITE|FIXED, fd: 3, off: 1863680) = 0x7fba6dde7000
0.125 ( 0.004 ms): madvise/11732 mmap(addr: 0x7fba6dded000, len: 14688, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS|FIXED) = 0x7fba6dded000
0.150 ( 0.006 ms): madvise/11732 mmap(len: 12288, prot: READ|WRITE, flags: PRIVATE|ANONYMOUS ) = 0x7fba6dfea000
0.288 ( 0.003 ms): madvise/11732 mmap(len: 4096, flags: PRIVATE|ANONYMOUS ) = 0x7fba6e014000
0.292 ( 0.002 ms): madvise/11732 madvise(start: 0x7fba6e014000, len_in: 4096, behavior: MADV_WIPEONFORK) = 0
0.295 ( 0.001 ms): madvise/11732 madvise(start: 0x7fba6e014000, len_in: 4096, behavior: MADV_KEEPONFORK) = 0
# uname -a
Linux jouet 4.13.0+ #2 SMP Mon Sep 18 17:22:46 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
#
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Mike Kravetz <mike.kravetz@...cle.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Rik van Riel <riel@...hat.com>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-yev9rexu02cl7cjeozzmrl9t@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/include/uapi/asm-generic/mman-common.h | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/tools/include/uapi/asm-generic/mman-common.h b/tools/include/uapi/asm-generic/mman-common.h
index 8c27db0..203268f 100644
--- a/tools/include/uapi/asm-generic/mman-common.h
+++ b/tools/include/uapi/asm-generic/mman-common.h
@@ -58,20 +58,12 @@
overrides the coredump filter bits */
#define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag */
+#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
+#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
+
/* compatibility flags */
#define MAP_FILE 0
-/*
- * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
- * This gives us 6 bits, which is enough until someone invents 128 bit address
- * spaces.
- *
- * Assume these are all power of twos.
- * When 0 use the default page size.
- */
-#define MAP_HUGE_SHIFT 26
-#define MAP_HUGE_MASK 0x3f
-
#define PKEY_DISABLE_ACCESS 0x1
#define PKEY_DISABLE_WRITE 0x2
#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
Powered by blists - more mailing lists