From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757972AbcGKGmE (ORCPT ); Mon, 11 Jul 2016 02:42:04 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:33656 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757922AbcGKGmA (ORCPT ); Mon, 11 Jul 2016 02:42:00 -0400 From: zhongjiang To: CC: , Subject: [PATCH 1/2] kexec: remove unnecessary unusable_pages Date: Mon, 11 Jul 2016 14:36:00 +0800 Message-ID: <1468218961-11018-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.57833FB1.005A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ba772f7ff065a67f3cc1b0044f3093f5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhong jiang In general, kexec alloc pages from buddy system, it cannot exceed the physical address in the system. The patch just remove this code, no functional change. Signed-off-by: zhong jiang --- 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 */ -- 1.8.3.1