Re: [PATCH -v2] debug-pagealloc: add support for highmem pages

From: Andrew Morton
Date: Thu Aug 25 2011 - 20:03:09 EST


On Thu, 25 Aug 2011 23:14:09 +0900
Akinobu Mita <akinobu.mita@xxxxxxxxx> wrote:

> This adds support for highmem pages poisoning and verification to the
> debug-pagealloc feature for no-architecture support.
>

Sorry, I had a brainfart. kmap_atomic() internally does the
preempt_disable() (actually pagefault_disable()).

--- a/mm/debug-pagealloc.c~debug-pagealloc-add-support-for-highmem-pages-fix
+++ a/mm/debug-pagealloc.c
@@ -23,14 +23,11 @@ static inline bool page_poison(struct pa

static void poison_page(struct page *page)
{
- void *addr;
+ void *addr = kmap_atomic(page);

- preempt_disable();
- addr = kmap_atomic(page);
set_page_poison(page);
memset(addr, PAGE_POISON, PAGE_SIZE);
kunmap_atomic(addr);
- preempt_enable();
}

static void poison_pages(struct page *page, int n)
@@ -82,12 +79,10 @@ static void unpoison_page(struct page *p
if (!page_poison(page))
return;

- preempt_disable();
addr = kmap_atomic(page);
check_poison_mem(addr, PAGE_SIZE);
clear_page_poison(page);
kunmap_atomic(addr);
- preempt_enable();
}

static void unpoison_pages(struct page *page, int n)
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/