* Re: [PATCH] mm/page_poison: move PAGE_POISON to page_poison.c
[not found] <1518163694-27155-1-git-send-email-wei.w.wang@intel.com>
@ 2018-02-09 16:23 ` Michael S. Tsirkin
2018-02-13 10:16 ` Michal Hocko
[not found] ` <20180213101615.GO3443@dhcp22.suse.cz>
2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2018-02-09 16:23 UTC (permalink / raw)
To: Wei Wang; +Cc: linux-mm, akpm, mhocko, linux-kernel, virtualization
On Fri, Feb 09, 2018 at 04:08:14PM +0800, Wei Wang wrote:
> 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.
>
> Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> ---
> include/linux/poison.h | 7 -------
> mm/page_poison.c | 6 ++++++
> 2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/poison.h b/include/linux/poison.h
> index 15927eb..348bf67 100644
> --- a/include/linux/poison.h
> +++ b/include/linux/poison.h
> @@ -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)
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.
> diff --git a/mm/page_poison.c b/mm/page_poison.c
> index e83fd44..8aaf076 100644
> --- a/mm/page_poison.c
> +++ b/mm/page_poison.c
> @@ -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)
> --
> 2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mm/page_poison: move PAGE_POISON to page_poison.c
[not found] <1518163694-27155-1-git-send-email-wei.w.wang@intel.com>
2018-02-09 16:23 ` [PATCH] mm/page_poison: move PAGE_POISON to page_poison.c Michael S. Tsirkin
@ 2018-02-13 10:16 ` Michal Hocko
[not found] ` <20180213101615.GO3443@dhcp22.suse.cz>
2 siblings, 0 replies; 4+ messages in thread
From: Michal Hocko @ 2018-02-13 10:16 UTC (permalink / raw)
To: Wei Wang; +Cc: linux-mm, akpm, mst, linux-kernel, virtualization
On Fri 09-02-18 16:08:14, Wei Wang wrote:
> 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.
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.
> Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> ---
> include/linux/poison.h | 7 -------
> mm/page_poison.c | 6 ++++++
> 2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/poison.h b/include/linux/poison.h
> index 15927eb..348bf67 100644
> --- a/include/linux/poison.h
> +++ b/include/linux/poison.h
> @@ -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)
> diff --git a/mm/page_poison.c b/mm/page_poison.c
> index e83fd44..8aaf076 100644
> --- a/mm/page_poison.c
> +++ b/mm/page_poison.c
> @@ -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)
> --
> 2.7.4
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <20180213101615.GO3443@dhcp22.suse.cz>]
* Re: [PATCH] mm/page_poison: move PAGE_POISON to page_poison.c
[not found] ` <20180213101615.GO3443@dhcp22.suse.cz>
@ 2018-02-26 4:37 ` Wei Wang
0 siblings, 0 replies; 4+ messages in thread
From: Wei Wang @ 2018-02-26 4:37 UTC (permalink / raw)
To: Michal Hocko; +Cc: linux-mm, akpm, mst, linux-kernel, virtualization
On 02/13/2018 06:16 PM, Michal Hocko wrote:
> On Fri 09-02-18 16:08:14, Wei Wang wrote:
>> 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.
> 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.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] mm/page_poison: move PAGE_POISON to page_poison.c
@ 2018-02-09 8:08 Wei Wang
0 siblings, 0 replies; 4+ messages in thread
From: Wei Wang @ 2018-02-09 8:08 UTC (permalink / raw)
To: linux-kernel, virtualization, linux-mm, mst, mhocko, akpm
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.
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
---
include/linux/poison.h | 7 -------
mm/page_poison.c | 6 ++++++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 15927eb..348bf67 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -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)
diff --git a/mm/page_poison.c b/mm/page_poison.c
index e83fd44..8aaf076 100644
--- a/mm/page_poison.c
+++ b/mm/page_poison.c
@@ -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)
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-26 4:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1518163694-27155-1-git-send-email-wei.w.wang@intel.com>
2018-02-09 16:23 ` [PATCH] mm/page_poison: move PAGE_POISON to page_poison.c Michael S. Tsirkin
2018-02-13 10:16 ` Michal Hocko
[not found] ` <20180213101615.GO3443@dhcp22.suse.cz>
2018-02-26 4:37 ` Wei Wang
2018-02-09 8:08 Wei Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox