linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: zhongjiang <zhongjiang@huawei.com>
Cc: dyoung@redhat.com, horms@verge.net.au, vgoyal@redhat.com,
	yinghai@kernel.org, akpm@linux-foundation.org,
	kexec@lists.infradead.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] kexec: remove unnecessary unusable_pages
Date: Tue, 12 Jul 2016 10:19:43 -0500	[thread overview]
Message-ID: <87poqi3muo.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <1468299403-27954-1-git-send-email-zhongjiang@huawei.com> (zhongjiang@huawei.com's message of "Tue, 12 Jul 2016 12:56:42 +0800")

zhongjiang <zhongjiang@huawei.com> writes:

> From: zhong jiang <zhongjiang@huawei.com>
>
> In general, kexec alloc pages from buddy system, it cannot exceed
> the physical address in the system.
>
> The patch just remove this unnecessary code, no functional change.

On 32bit systems with highmem support kexec can very easily receive a
page from the buddy allocator that can exceed 4GiB.  This doesn't show
up on 64bit systems as typically the memory limits are less than the
address space.  But this code is very necessary on some systems and
removing it is not ok.

Nacked-by: "Eric W. Biederman" <ebiederm@xmission.com>


>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  include/linux/kexec.h |  1 -
>  kernel/kexec_core.c   | 13 -------------
>  2 files changed, 14 deletions(-)
>
> diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> index e8acb2b..26e4917 100644
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -162,7 +162,6 @@ struct kimage {
>  
>  	struct list_head control_pages;
>  	struct list_head dest_pages;
> -	struct list_head unusable_pages;
>  
>  	/* Address of next control page to allocate for crash kernels. */
>  	unsigned long control_page;
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 56b3ed0..448127d 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -257,9 +257,6 @@ struct kimage *do_kimage_alloc_init(void)
>  	/* Initialize the list of destination pages */
>  	INIT_LIST_HEAD(&image->dest_pages);
>  
> -	/* Initialize the list of unusable pages */
> -	INIT_LIST_HEAD(&image->unusable_pages);
> -
>  	return image;
>  }
>  
> @@ -517,10 +514,6 @@ static void kimage_free_extra_pages(struct kimage *image)
>  {
>  	/* Walk through and free any extra destination pages I may have */
>  	kimage_free_page_list(&image->dest_pages);
> -
> -	/* Walk through and free any unusable pages I have cached */
> -	kimage_free_page_list(&image->unusable_pages);
> -
>  }
>  void kimage_terminate(struct kimage *image)
>  {
> @@ -647,12 +640,6 @@ static struct page *kimage_alloc_page(struct kimage *image,
>  		page = kimage_alloc_pages(gfp_mask, 0);
>  		if (!page)
>  			return NULL;
> -		/* If the page cannot be used file it away */
> -		if (page_to_pfn(page) >
> -				(KEXEC_SOURCE_MEMORY_LIMIT >> PAGE_SHIFT)) {
> -			list_add(&page->lru, &image->unusable_pages);
> -			continue;
> -		}
>  		addr = page_to_pfn(page) << PAGE_SHIFT;
>  
>  		/* If it is the destination page we want use it */

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2016-07-12 15:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  4:56 zhongjiang
2016-07-12  4:56 ` [PATCH 2/2] kexec: add a pmd huge entry condition during the page table zhongjiang
2016-07-12 15:46   ` Eric W. Biederman
2016-07-13  7:01     ` zhong jiang
2016-07-14 13:19       ` Eric W. Biederman
2016-07-20  7:25         ` zhong jiang
2016-07-12 15:19 ` Eric W. Biederman [this message]
2016-07-13  4:08   ` [PATCH 1/2] kexec: remove unnecessary unusable_pages zhong jiang
2016-07-13  5:07     ` Eric W. Biederman
2016-07-13  7:07       ` zhong jiang
  -- strict thread matches above, loose matches on Subject: below --
2016-07-11  6:36 zhongjiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87poqi3muo.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=dyoung@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=vgoyal@redhat.com \
    --cc=yinghai@kernel.org \
    --cc=zhongjiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox