From: Helge Deller <deller@gmx.de>
To: linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
James Bottomley <James.Bottomley@HansenPartnership.com>,
John David Anglin <dave.anglin@bell.net>
Subject: [PATCH] parisc: Fix up generic MADV_* values and add MADV_HWPOISON and MADV_SOFT_OFFLINE
Date: Fri, 4 Aug 2017 18:31:48 +0200 [thread overview]
Message-ID: <20170804163148.GA29168@p100.box> (raw)
This patch adds the missing MADV_HWPOISON (100) and MADV_SOFT_OFFLINE (101)
defines which are needed for an upcoming patch which adds page-deallocation to
parisc.
In addition there is a conflict with some the common/generic MADV_* constants
between kernel headers and glibc headers. The existing glibc headers on parisc
already define those values in the range of 8-17 which should be common between
all architectures and which all architectures with the exception of parisc
follow. But the parisc kernel still defines those with values above 65 because
of an old kernel patch which reserved the range of 12-64 for page size
specifications. The old kernel patch never actually used those values in code,
so changing those MADV_* constants back to the common values shouldn't break
anything and instead make existing userspace applications work as expected.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h
index 5979745..a34ebf4 100644
--- a/arch/parisc/include/uapi/asm/mman.h
+++ b/arch/parisc/include/uapi/asm/mman.h
@@ -49,16 +49,18 @@
#define MADV_REMOVE 9 /* remove these pages & resources */
#define MADV_DONTFORK 10 /* don't inherit across fork */
#define MADV_DOFORK 11 /* do inherit across fork */
+#define MADV_HWPOISON 100 /* poison a page for testing */
+#define MADV_SOFT_OFFLINE 101 /* soft offline page for testing */
-#define MADV_MERGEABLE 65 /* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */
+#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
-#define MADV_HUGEPAGE 67 /* Worth backing with hugepages */
-#define MADV_NOHUGEPAGE 68 /* Not worth backing with hugepages */
+#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
+#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
-#define MADV_DONTDUMP 69 /* Explicity exclude from the core dump,
+#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
-#define MADV_DODUMP 70 /* Clear the MADV_NODUMP flag */
+#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */
/* compatibility flags */
#define MAP_FILE 0
diff --git a/tools/arch/parisc/include/uapi/asm/mman.h b/tools/arch/parisc/include/uapi/asm/mman.h
index 03d8d5b..eb4df3e 100644
--- a/tools/arch/parisc/include/uapi/asm/mman.h
+++ b/tools/arch/parisc/include/uapi/asm/mman.h
@@ -1,20 +1,22 @@
#ifndef TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H
-#define MADV_DODUMP 70
-#define MADV_DOFORK 11
-#define MADV_DONTDUMP 69
-#define MADV_DONTFORK 10
-#define MADV_DONTNEED 4
-#define MADV_FREE 8
-#define MADV_HUGEPAGE 67
-#define MADV_MERGEABLE 65
-#define MADV_NOHUGEPAGE 68
#define MADV_NORMAL 0
#define MADV_RANDOM 1
-#define MADV_REMOVE 9
#define MADV_SEQUENTIAL 2
-#define MADV_UNMERGEABLE 66
#define MADV_WILLNEED 3
+#define MADV_DONTNEED 4
+#define MADV_FREE 8
+#define MADV_REMOVE 9
+#define MADV_DONTFORK 10
+#define MADV_DOFORK 11
+#define MADV_HWPOISON 100
+#define MADV_SOFT_OFFLINE 101
+#define MADV_MERGEABLE 12
+#define MADV_UNMERGEABLE 13
+#define MADV_HUGEPAGE 14
+#define MADV_NOHUGEPAGE 15
+#define MADV_DONTDUMP 16
+#define MADV_DODUMP 17
#define MAP_ANONYMOUS 0x10
#define MAP_DENYWRITE 0x0800
#define MAP_EXECUTABLE 0x1000
@@ -36,10 +38,6 @@
#define PROT_READ 0x1
#define PROT_SEM 0x8
#define PROT_WRITE 0x2
-/* MADV_HWPOISON is undefined on parisc, fix it for perf */
-#define MADV_HWPOISON 100
-/* MADV_SOFT_OFFLINE is undefined on parisc, fix it for perf */
-#define MADV_SOFT_OFFLINE 101
/* MAP_32BIT is undefined on parisc, fix it for perf */
#define MAP_32BIT 0
/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */
next reply other threads:[~2017-08-04 16:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 16:31 Helge Deller [this message]
2017-08-04 17:57 ` [PATCH] parisc: Fix up generic MADV_* values and add MADV_HWPOISON and MADV_SOFT_OFFLINE Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170804163148.GA29168@p100.box \
--to=deller@gmx.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dave.anglin@bell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox