Re: [PATCH 1/3] swsusp add architecture special saveable pagessupport

From: Andrew Morton
Date: Wed Apr 12 2006 - 17:14:51 EST


Shaohua Li <shaohua.li@xxxxxxxxx> wrote:
>
> +static int save_arch_mem(void)
> +{
> + void *kaddr;
> + struct arch_saveable_page *tmp = arch_pages;
> +
> + pr_debug("swsusp: Saving arch specific memory");
> + while (tmp) {
> + tmp->data = (void *)get_zeroed_page(GFP_ATOMIC);

There's no need to zero the page here.

> + if (!tmp->data)
> + return -ENOMEM;
> + /* arch pages might haven't a 'struct page' */
> + kaddr = kmap_atomic_pfn(tmp->pfn, KM_PTE0);
> + memcpy(tmp->data, kaddr, PAGE_SIZE);
> + kunmap_atomic(kaddr, KM_PTE0);

Why was KM_PTE0 chosen here?
-
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/