Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3300973imj; Mon, 11 Feb 2019 18:14:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IYsiq7JFMGN7GrM11y9JQJSrIdHT8DOEUvlhJJHRVu8zPnq3lnFs2aGsyXuoTgo0+nsvh7Z X-Received: by 2002:a17:902:64:: with SMTP id 91mr1529851pla.229.1549937641194; Mon, 11 Feb 2019 18:14:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549937641; cv=none; d=google.com; s=arc-20160816; b=VSLjZlQ7WUN8oUrGJeKkVJgPYqd2VV+ZLNHJN7KXoqRBHr2NhauZ+pC2lFphQIFfhx zBc5Ew/FkwU+yag5cL4f+rdyimKLElGbe58RMk7Rj0fX4NoBHC7tEsXT88GUkAfft3+G RnaMJ4VxltzhJWUR4nRXy360sI6Q67hU46jWn45PDaXK/PP9rdCgJypdfV8t6JT8OJAH Z1OdrLjpdVuJN2Y3wZQAsrlRWnHD8Id71V7sc5qyD//n0aS0/JLA7gSZ4QJVymwGHEjL YVt4XONQ42fA+W4GU9B3V9D8lCD4gmTg326HdQegqgR+5KpiyotL1BpAAuheR2Pq1clV qtaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jJYMwVrsafoqKXbLBvp0ZyvJLj3kLX1J8g0tr4DgrRk=; b=bGRqmo3PR9pw5i4VJOG0a3Nt7ZvIU7ubelEpeBk9XRBri6wXPBjfU/6Kp3T2fO7RWJ Fx1l3HvL1Cr4IabVUTZHgb+DnzE4sHmsBimZU/y62Z7TPrlbrrxagXY2x8OrhcoPiiRU IGLIr63IC95VU3QvGQlCRCduyYYKez3VKeWjEoxI8grgjcGG5cXycYqn7sJRaf5R5p3+ oc4ZFWv4MGL1i9uVM4qmqL6BlQ00r1iYvgd1VGD5dFzsMCVeIJGMlNLP0Cxqntr8iR8o Yi0CVe3BCp0rU+fM2AhcDrsZfoTliOfjWObdwXwvIISAEq3U7U0W7c54ZgNavBRUkNv1 cUuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si230110pga.297.2019.02.11.18.13.45; Mon, 11 Feb 2019 18:14:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728068AbfBLCNH (ORCPT + 99 others); Mon, 11 Feb 2019 21:13:07 -0500 Received: from mga09.intel.com ([134.134.136.24]:26873 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727951AbfBLCNB (ORCPT ); Mon, 11 Feb 2019 21:13:01 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2019 18:13:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,361,1544515200"; d="scan'208";a="146057862" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga001.fm.intel.com with ESMTP; 11 Feb 2019 18:12:59 -0800 From: Wei Yang To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.or, tglx@linutronix.de, Wei Yang Subject: [PATCH 6/6] x86, mm: x86, mm: jump to split only 4K range when range doesn't span PMD Date: Tue, 12 Feb 2019 10:12:15 +0800 Message-Id: <20190212021215.13247-7-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190212021215.13247-1-richardw.yang@linux.intel.com> References: <20190212021215.13247-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case the first attempt to round_up pfn with PMD_SIZE exceed the limit_pfn, this means we could only have 4K range. This patch jumps to split only 4K range for this case. Signed-off-by: Wei Yang --- arch/x86/mm/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index cbb105388f24..bf422a637035 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -383,7 +383,7 @@ static int __meminit split_mem_range(struct map_range *mr, end_pfn = round_up(pfn, PFN_DOWN(PMD_SIZE)); #endif if (end_pfn > limit_pfn) - end_pfn = limit_pfn; + goto only_4K_range; if (start_pfn < end_pfn) { nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); pfn = end_pfn; @@ -435,6 +435,7 @@ static int __meminit split_mem_range(struct map_range *mr, * Range (E): * tail is not big page (2M) alignment */ +only_4K_range: start_pfn = pfn; end_pfn = limit_pfn; nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); -- 2.19.1