mm/page_poison: move PAGE_POISON to page_poison.c
Subsystems (3)
PATCH 1/1 mm/page_poison: move PAGE_POISON to page_poison.c
The PAGE_POISON macro is used in page_poison.c only, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete.
--- include/linux/poison.h | 7 ------- mm/page_poison.c | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-)
include/linux/poison.h +0 -7
@@ -30,13 +30,6 @@*/ #define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA) -/********** mm/debug-pagealloc.c **********/ -#ifdef CONFIG_PAGE_POISONING_ZERO -#define PAGE_POISON 0x00 -#else -#define PAGE_POISON 0xaa -#endif -/********** mm/page_alloc.c ************/ #define TAIL_MAPPING ((void *) 0x400 + POISON_POINTER_DELTA)
mm/page_poison.c +6 -0
@@ -7,6 +7,12 @@#include <linux/poison.h> #include <linux/ratelimit.h> +#ifdef CONFIG_PAGE_POISONING_ZERO +#define PAGE_POISON 0x00 +#else +#define PAGE_POISON 0xaa +#endif +static bool want_page_poisoning__read_mostly ;static int early_page_poison_param (char *buf)
Signature · 1 line
2.7.4
Michael S. Tsirkin
maintainerQuoted 21 lines · Wei Wang
The
PAGE_POISONmacro is used inpage_poison.conly, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete.Signed-off-by Wei Wang <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Michael S. Tsirkin <[email protected]>--- include/linux/poison.h | 7 ------- mm/page_poison.c | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-)include/linux/poison.h +0
-0@@ -30,13 +30,6 @@*/ #define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA)
include/linux/poison.h line 35
Quoted 10 lines
include/linux/poison.h +0
-7-/********** mm/debug-pagealloc.c **********/ -#ifdef CONFIG_PAGE_POISONING_ZERO -#define PAGE_POISON 0x00 -#else -#define PAGE_POISON 0xaa -#endif -/********** mm/page_alloc.c ************/ #define TAIL_MAPPING ((void *) 0x400 + POISON_POINTER_DELTA)
My question is, why are these macros kept in a single header. Is it so it's easy to figure out source of a crash by looking at the data and locating it in the file?
If so we should keep it in the header, but fix the comment. If no there are more macros to move out, like flex array ones.
Quoted 19 lines
mm/page_poison.c +6
-0@@ -7,6 +7,12 @@#include <linux/poison.h> #include <linux/ratelimit.h> +#ifdef CONFIG_PAGE_POISONING_ZERO +#define PAGE_POISON 0x00 +#else +#define PAGE_POISON 0xaa +#endif +static bool want_page_poisoning__read_mostly ;static int early_page_poison_param (char *buf)Signature · 1 line
2.7.4
Michael S. Tsirkin
maintainerQuoted 21 lines · Wei Wang
The
PAGE_POISONmacro is used inpage_poison.conly, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete.Signed-off-by Wei Wang <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Michael S. Tsirkin <[email protected]>--- include/linux/poison.h | 7 ------- mm/page_poison.c | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-)include/linux/poison.h +0
-0@@ -30,13 +30,6 @@*/ #define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA)
include/linux/poison.h line 35
Quoted 10 lines
include/linux/poison.h +0
-7-/********** mm/debug-pagealloc.c **********/ -#ifdef CONFIG_PAGE_POISONING_ZERO -#define PAGE_POISON 0x00 -#else -#define PAGE_POISON 0xaa -#endif -/********** mm/page_alloc.c ************/ #define TAIL_MAPPING ((void *) 0x400 + POISON_POINTER_DELTA)
My question is, why are these macros kept in a single header. Is it so it's easy to figure out source of a crash by looking at the data and locating it in the file?
If so we should keep it in the header, but fix the comment. If no there are more macros to move out, like flex array ones.
Quoted 19 lines
mm/page_poison.c +6
-0@@ -7,6 +7,12 @@#include <linux/poison.h> #include <linux/ratelimit.h> +#ifdef CONFIG_PAGE_POISONING_ZERO +#define PAGE_POISON 0x00 +#else +#define PAGE_POISON 0xaa +#endif +static bool want_page_poisoning__read_mostly ;static int early_page_poison_param (char *buf)Signature · 1 line
2.7.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Wei Wang
The
PAGE_POISONmacro is used inpage_poison.conly, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete.
Why is this an improvement? I thought the whole point of poison.h is to keep all the poison value at a single place to make them obviously unique.
Quoted 46 lines
Signed-off-by Wei Wang <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Michael S. Tsirkin <[email protected]>--- include/linux/poison.h | 7 ------- mm/page_poison.c | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-)include/linux/poison.h +0
-7@@ -30,13 +30,6 @@*/ #define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA) -/********** mm/debug-pagealloc.c **********/ -#ifdef CONFIG_PAGE_POISONING_ZERO -#define PAGE_POISON 0x00 -#else -#define PAGE_POISON 0xaa -#endif -/********** mm/page_alloc.c ************/ #define TAIL_MAPPING ((void *) 0x400 + POISON_POINTER_DELTA)mm/page_poison.c +6
-0@@ -7,6 +7,12 @@#include <linux/poison.h> #include <linux/ratelimit.h> +#ifdef CONFIG_PAGE_POISONING_ZERO +#define PAGE_POISON 0x00 +#else +#define PAGE_POISON 0xaa +#endif +static bool want_page_poisoning__read_mostly ;static int early_page_poison_param (char *buf)Signature · 1 line
2.7.4
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 3 lines · Wei Wang
The
PAGE_POISONmacro is used inpage_poison.conly, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete.
Why is this an improvement? I thought the whole point of poison.h is to keep all the poison value at a single place to make them obviously unique.
Quoted 46 lines
Signed-off-by Wei Wang <[email protected]>Cc Andrew Morton <[email protected]>Cc Michal Hocko <[email protected]>Cc Michael S. Tsirkin <[email protected]>--- include/linux/poison.h | 7 ------- mm/page_poison.c | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-)include/linux/poison.h +0
-7@@ -30,13 +30,6 @@*/ #define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA) -/********** mm/debug-pagealloc.c **********/ -#ifdef CONFIG_PAGE_POISONING_ZERO -#define PAGE_POISON 0x00 -#else -#define PAGE_POISON 0xaa -#endif -/********** mm/page_alloc.c ************/ #define TAIL_MAPPING ((void *) 0x400 + POISON_POINTER_DELTA)mm/page_poison.c +6
-0@@ -7,6 +7,12 @@#include <linux/poison.h> #include <linux/ratelimit.h> +#ifdef CONFIG_PAGE_POISONING_ZERO +#define PAGE_POISON 0x00 +#else +#define PAGE_POISON 0xaa +#endif +static bool want_page_poisoning__read_mostly ;static int early_page_poison_param (char *buf)Signature · 1 line
2.7.4
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Michal Hocko
Quoted 3 lines · Wei Wang
The
PAGE_POISONmacro is used inpage_poison.conly, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete.Why is this an improvement? I thought the whole point of
poison.his to keep all the poison value at a single place to make them obviously unique.
There isn't a comment explaining why they are exposed. We did this because PAGE_POISON is used by page_poison.c only, it seems not necessary to expose the private values. Why would it be not unique if moved to page_poison.c (on condition that it is only used there)?
Best,
Wei
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>