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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shaohua Li <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux