Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1317566
| From | Jianyu Zhan <nasa4836@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option |
| Date | 2016-01-26 07:50 +0100 |
| Message-ID | <qV5BT-8fo-11@gated-at.bofh.it> (permalink) |
| References | <qUSEG-6QD-11@gated-at.bofh.it> <qUSEJ-6QD-75@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Jan 26, 2016 at 12:55 AM, Laura Abbott
<labbott@fedoraproject.org> wrote:
> --- a/mm/debug-pagealloc.c
> +++ b/mm/debug-pagealloc.c
> @@ -8,11 +8,5 @@
>
> void __kernel_map_pages(struct page *page, int numpages, int enable)
> {
> - if (!page_poisoning_enabled())
> - return;
> -
> - if (enable)
> - unpoison_pages(page, numpages);
> - else
> - poison_pages(page, numpages);
> + kernel_poison_pages(page, numpages, enable);
> }
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 63358d9..c733421 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1002,6 +1002,7 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
> PAGE_SIZE << order);
> }
> arch_free_page(page, order);
> + kernel_poison_pages(page, 1 << order, 0);
> kernel_map_pages(page, 1 << order, 0);
>
> return true;
> @@ -1396,6 +1397,7 @@ static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags,
> set_page_refcounted(page);
>
> arch_alloc_page(page, order);
> + kernel_poison_pages(page, 1 << order, 1);
> kernel_map_pages(page, 1 << order, 1);
> kasan_alloc_pages(page, order);
>
kernel_map_pages() will fall back to page poisoning scheme for
!ARCH_SUPPORTS_DEBUG_PAGEALLOC.
IIUC, calling kernel_poison_pages() before kernel_map_pages() will be
equivalent to call kernel_poison_pages()
twice?!
Thanks,
Jianyu Zhan
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option Laura Abbott <labbott@fedoraproject.org> - 2016-01-25 18:00 +0100
Re: [RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option Jianyu Zhan <nasa4836@gmail.com> - 2016-01-26 07:50 +0100
Re: [RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option Laura Abbott <labbott@redhat.com> - 2016-01-26 21:30 +0100
csiph-web