All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON
@ 2009-08-21 18:30 ` Hugh Dickins
  0 siblings, 0 replies; 6+ messages in thread
From: Hugh Dickins @ 2009-08-21 18:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andi Kleen, Wu Fengguang, Izik Eidus, Chris Wright,
	Andrea Arcangeli, Michael Kerrisk, Richard Henderson,
	Ivan Kokshaysky, Ralf Baechle, Kyle McMartin, Helge Deller,
	Chris Zankel, Rik van RIel, Balbir Singh, KAMEZAWA Hiroyuki,
	Avi Kivity, Nick Piggin, linux-kernel, linux-mm

linux-next is now sporting MADV_HWPOISON at 12, which would have a very
nasty effect on KSM if you had CONFIG_MEMORY_FAILURE=y with CONFIG_KSM=y.
Shift MADV_MERGEABLE and MADV_UNMERGEABLE down two - two to reduce the
confusion if old and new userspace and kernel are mismatched.

Personally I'd prefer the MADV_HWPOISON testing feature to shift; but
linux-next comes first in the mmotm lineup, and I can't be sure that
madvise KSM already has more users than there are HWPOISON testers:
so unless Andi is happy to shift MADV_HWPOISON, mmotm needs this.
---
Fix to ksm-define-madv_mergeable-and-madv_unmergeable.patch
parisc unaffected because its MADVs are displaced.

 arch/alpha/include/asm/mman.h     |    4 ++--
 arch/mips/include/asm/mman.h      |    4 ++--
 arch/xtensa/include/asm/mman.h    |    4 ++--
 include/asm-generic/mman-common.h |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

--- mmotm/arch/alpha/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/alpha/include/asm/mman.h	2009-08-21 18:28:14.000000000 +0100
@@ -48,8 +48,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/arch/mips/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/mips/include/asm/mman.h	2009-08-21 18:28:24.000000000 +0100
@@ -71,8 +71,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/arch/xtensa/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/xtensa/include/asm/mman.h	2009-08-21 18:28:52.000000000 +0100
@@ -78,8 +78,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/include/asm-generic/mman-common.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/include/asm-generic/mman-common.h	2009-08-21 18:29:01.000000000 +0100
@@ -36,8 +36,8 @@
 #define MADV_DOFORK	11		/* do inherit across fork */
 #define MADV_HWPOISON	12		/* poison a page for testing */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON
@ 2009-08-21 18:30 ` Hugh Dickins
  0 siblings, 0 replies; 6+ messages in thread
From: Hugh Dickins @ 2009-08-21 18:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andi Kleen, Wu Fengguang, Izik Eidus, Chris Wright,
	Andrea Arcangeli, Michael Kerrisk, Richard Henderson,
	Ivan Kokshaysky, Ralf Baechle, Kyle McMartin, Helge Deller,
	Chris Zankel, Rik van RIel, Balbir Singh, KAMEZAWA Hiroyuki,
	Avi Kivity, Nick Piggin, linux-kernel, linux-mm

linux-next is now sporting MADV_HWPOISON at 12, which would have a very
nasty effect on KSM if you had CONFIG_MEMORY_FAILURE=y with CONFIG_KSM=y.
Shift MADV_MERGEABLE and MADV_UNMERGEABLE down two - two to reduce the
confusion if old and new userspace and kernel are mismatched.

Personally I'd prefer the MADV_HWPOISON testing feature to shift; but
linux-next comes first in the mmotm lineup, and I can't be sure that
madvise KSM already has more users than there are HWPOISON testers:
so unless Andi is happy to shift MADV_HWPOISON, mmotm needs this.
---
Fix to ksm-define-madv_mergeable-and-madv_unmergeable.patch
parisc unaffected because its MADVs are displaced.

 arch/alpha/include/asm/mman.h     |    4 ++--
 arch/mips/include/asm/mman.h      |    4 ++--
 arch/xtensa/include/asm/mman.h    |    4 ++--
 include/asm-generic/mman-common.h |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

--- mmotm/arch/alpha/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/alpha/include/asm/mman.h	2009-08-21 18:28:14.000000000 +0100
@@ -48,8 +48,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/arch/mips/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/mips/include/asm/mman.h	2009-08-21 18:28:24.000000000 +0100
@@ -71,8 +71,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/arch/xtensa/include/asm/mman.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/arch/xtensa/include/asm/mman.h	2009-08-21 18:28:52.000000000 +0100
@@ -78,8 +78,8 @@
 #define MADV_DONTFORK	10		/* don't inherit across fork */
 #define MADV_DOFORK	11		/* do inherit across fork */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0
--- mmotm/include/asm-generic/mman-common.h	2009-08-21 12:08:18.000000000 +0100
+++ linux/include/asm-generic/mman-common.h	2009-08-21 18:29:01.000000000 +0100
@@ -36,8 +36,8 @@
 #define MADV_DOFORK	11		/* do inherit across fork */
 #define MADV_HWPOISON	12		/* poison a page for testing */
 
-#define MADV_MERGEABLE   12		/* KSM may merge identical pages */
-#define MADV_UNMERGEABLE 13		/* KSM may not merge identical pages */
+#define MADV_MERGEABLE   14		/* KSM may merge identical pages */
+#define MADV_UNMERGEABLE 15		/* KSM may not merge identical pages */
 
 /* compatibility flags */
 #define MAP_FILE	0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON
  2009-08-21 18:30 ` Hugh Dickins
@ 2009-08-21 18:41   ` Andi Kleen
  -1 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2009-08-21 18:41 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Andi Kleen, Wu Fengguang, Izik Eidus,
	Chris Wright, Andrea Arcangeli, Michael Kerrisk,
	Richard Henderson, Ivan Kokshaysky, Ralf Baechle, Kyle McMartin,
	Helge Deller, Chris Zankel, Rik van RIel, Balbir Singh,
	KAMEZAWA Hiroyuki, Avi Kivity, Nick Piggin, linux-kernel,
	linux-mm

On Fri, Aug 21, 2009 at 07:30:15PM +0100, Hugh Dickins wrote:
> linux-next is now sporting MADV_HWPOISON at 12, which would have a very
> nasty effect on KSM if you had CONFIG_MEMORY_FAILURE=y with CONFIG_KSM=y.
> Shift MADV_MERGEABLE and MADV_UNMERGEABLE down two - two to reduce the
> confusion if old and new userspace and kernel are mismatched.
> 
> Personally I'd prefer the MADV_HWPOISON testing feature to shift; but
> linux-next comes first in the mmotm lineup, and I can't be sure that
> madvise KSM already has more users than there are HWPOISON testers:
> so unless Andi is happy to shift MADV_HWPOISON, mmotm needs this.

Thanks for catching.

Shifting is fine, but I would prefer then if it was to some
value that is not reused (like 100) so that I can probe for it 
in the test programs.

-Andi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON
@ 2009-08-21 18:41   ` Andi Kleen
  0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2009-08-21 18:41 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Andi Kleen, Wu Fengguang, Izik Eidus,
	Chris Wright, Andrea Arcangeli, Michael Kerrisk,
	Richard Henderson, Ivan Kokshaysky, Ralf Baechle, Kyle McMartin,
	Helge Deller, Chris Zankel, Rik van RIel, Balbir Singh,
	KAMEZAWA Hiroyuki, Avi Kivity, Nick Piggin, linux-kernel,
	linux-mm

On Fri, Aug 21, 2009 at 07:30:15PM +0100, Hugh Dickins wrote:
> linux-next is now sporting MADV_HWPOISON at 12, which would have a very
> nasty effect on KSM if you had CONFIG_MEMORY_FAILURE=y with CONFIG_KSM=y.
> Shift MADV_MERGEABLE and MADV_UNMERGEABLE down two - two to reduce the
> confusion if old and new userspace and kernel are mismatched.
> 
> Personally I'd prefer the MADV_HWPOISON testing feature to shift; but
> linux-next comes first in the mmotm lineup, and I can't be sure that
> madvise KSM already has more users than there are HWPOISON testers:
> so unless Andi is happy to shift MADV_HWPOISON, mmotm needs this.

Thanks for catching.

Shifting is fine, but I would prefer then if it was to some
value that is not reused (like 100) so that I can probe for it 
in the test programs.

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON
  2009-08-21 18:41   ` Andi Kleen
@ 2009-08-21 19:23     ` Hugh Dickins
  -1 siblings, 0 replies; 6+ messages in thread
From: Hugh Dickins @ 2009-08-21 19:23 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Andrew Morton, Wu Fengguang, Izik Eidus, Chris Wright,
	Andrea Arcangeli, Michael Kerrisk, Richard Henderson,
	Ivan Kokshaysky, Ralf Baechle, Kyle McMartin, Helge Deller,
	Chris Zankel, Rik van RIel, Balbir Singh, KAMEZAWA Hiroyuki,
	Avi Kivity, Nick Piggin, linux-kernel, linux-mm

On Fri, 21 Aug 2009, Andi Kleen wrote:
> On Fri, Aug 21, 2009 at 07:30:15PM +0100, Hugh Dickins wrote:
> > linux-next is now sporting MADV_HWPOISON at 12, which would have a very
> > nasty effect on KSM if you had CONFIG_MEMORY_FAILURE=y with CONFIG_KSM=y.
> > Shift MADV_MERGEABLE and MADV_UNMERGEABLE down two - two to reduce the
> > confusion if old and new userspace and kernel are mismatched.
> > 
> > Personally I'd prefer the MADV_HWPOISON testing feature to shift; but
> > linux-next comes first in the mmotm lineup, and I can't be sure that
> > madvise KSM already has more users than there are HWPOISON testers:
> > so unless Andi is happy to shift MADV_HWPOISON, mmotm needs this.
> 
> Thanks for catching.
> 
> Shifting is fine, but I would prefer then if it was to some
> value that is not reused (like 100) so that I can probe for it 
> in the test programs.

Thanks a lot for conceding so generously, Andi.

Okay, let's forget that first patch I posted: here's its replacement,
fix to linux-next.patch in mmotm, but you'll put into your tree to be
picked up by linux-next in due course?  Thanks again.  (patch ends up
with the 100 line in between the 11 line and the 12 line, but doesn't
matter, it'll be easier to tidy that up with another patch afterwards.)


[PATCH] hwpoison: shift MADV_HWPOISON to 100

mm assigns KSM's MADV_MERGEABLE to 12: shift MADV_HWPOISON from 12 to 100,
out of the way so that poisoning test programs can safely probe for it.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---

 include/asm-generic/mman-common.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- next/include/asm-generic/mman-common.h	2009-08-21 19:51:15.000000000 +0100
+++ mmotm/include/asm-generic/mman-common.h	2009-08-21 19:53:21.000000000 +0100
@@ -34,7 +34,8 @@
 #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	12		/* poison a page for testing */
+
+#define MADV_HWPOISON	100		/* poison a page for testing */
 
 /* compatibility flags */
 #define MAP_FILE	0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON
@ 2009-08-21 19:23     ` Hugh Dickins
  0 siblings, 0 replies; 6+ messages in thread
From: Hugh Dickins @ 2009-08-21 19:23 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Andrew Morton, Wu Fengguang, Izik Eidus, Chris Wright,
	Andrea Arcangeli, Michael Kerrisk, Richard Henderson,
	Ivan Kokshaysky, Ralf Baechle, Kyle McMartin, Helge Deller,
	Chris Zankel, Rik van RIel, Balbir Singh, KAMEZAWA Hiroyuki,
	Avi Kivity, Nick Piggin, linux-kernel, linux-mm

On Fri, 21 Aug 2009, Andi Kleen wrote:
> On Fri, Aug 21, 2009 at 07:30:15PM +0100, Hugh Dickins wrote:
> > linux-next is now sporting MADV_HWPOISON at 12, which would have a very
> > nasty effect on KSM if you had CONFIG_MEMORY_FAILURE=y with CONFIG_KSM=y.
> > Shift MADV_MERGEABLE and MADV_UNMERGEABLE down two - two to reduce the
> > confusion if old and new userspace and kernel are mismatched.
> > 
> > Personally I'd prefer the MADV_HWPOISON testing feature to shift; but
> > linux-next comes first in the mmotm lineup, and I can't be sure that
> > madvise KSM already has more users than there are HWPOISON testers:
> > so unless Andi is happy to shift MADV_HWPOISON, mmotm needs this.
> 
> Thanks for catching.
> 
> Shifting is fine, but I would prefer then if it was to some
> value that is not reused (like 100) so that I can probe for it 
> in the test programs.

Thanks a lot for conceding so generously, Andi.

Okay, let's forget that first patch I posted: here's its replacement,
fix to linux-next.patch in mmotm, but you'll put into your tree to be
picked up by linux-next in due course?  Thanks again.  (patch ends up
with the 100 line in between the 11 line and the 12 line, but doesn't
matter, it'll be easier to tidy that up with another patch afterwards.)


[PATCH] hwpoison: shift MADV_HWPOISON to 100

mm assigns KSM's MADV_MERGEABLE to 12: shift MADV_HWPOISON from 12 to 100,
out of the way so that poisoning test programs can safely probe for it.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---

 include/asm-generic/mman-common.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- next/include/asm-generic/mman-common.h	2009-08-21 19:51:15.000000000 +0100
+++ mmotm/include/asm-generic/mman-common.h	2009-08-21 19:53:21.000000000 +0100
@@ -34,7 +34,8 @@
 #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	12		/* poison a page for testing */
+
+#define MADV_HWPOISON	100		/* poison a page for testing */
 
 /* compatibility flags */
 #define MAP_FILE	0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-21 19:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-21 18:30 [PATCH mmotm] ksm: antidote to MADV_MERGEABLE HWPOISON Hugh Dickins
2009-08-21 18:30 ` Hugh Dickins
2009-08-21 18:41 ` Andi Kleen
2009-08-21 18:41   ` Andi Kleen
2009-08-21 19:23   ` Hugh Dickins
2009-08-21 19:23     ` Hugh Dickins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.