Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3301412imj; Mon, 11 Feb 2019 18:14:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IZqDbdm7hD1lk4BjKF4u7BSqK2zCQJKoDpFDDiMBAxHQ/dSCJoIioN5zdJ/qUUywKYCBYpz X-Received: by 2002:a62:2c4d:: with SMTP id s74mr1519068pfs.6.1549937679579; Mon, 11 Feb 2019 18:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549937679; cv=none; d=google.com; s=arc-20160816; b=puuudeibEKOIcl7kfyLR4hlcmeGPEMlLbdbSJQDBs0zKgXkcxhjxFw7tmkKOTRh6X2 I76sE0rR/i+1SaQzvjx1HMOmMN88uOATIZ6m8d0jCf1ByF4sH4QiaTbo+ej7dHtDVE1b FH3ZEommlBtk+kWABaiCUq2Hg/2wpPYoKdRDjIVRhuyOqZgSrYWvDpHEtdE+on0LT0w5 ilVCSniCR9uqOztvBIqfC3ZMRJjGS0fJgFoD2pObgBUUBotOYGc59pu7EAX6owjEqH1f 8HhKhkwHEs8Apwpp0QtQNbPjh7jWyQxD83Ut9melLE6DZpYhkTs5GZEIAc+nDuW5iBOv MUgw== 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=LY2J8OxzlistyQLcjzHBUUecb5ly+cRftGmo15vpQps=; b=FNOMkazn0hDZudlueMn1TE5JHWG53eFy5VyGsPNe9VdnNfy4VrMq9R5tp28JwDMRzi LQAtpW7tQoOJ3PbNmlJ2SNHRiVIWK7FCkwEmSYbDaGUfHCzJWDZ4MYAG3Cey+e1RiIty cRc4FKlisQdi4ZrekIt8F8qCg5IztCnSELvKweYXTRZMK71jhfEsFB7AO4IqranZLfC1 nLiY19ZDuuq1H9dc/EwVaySgncKlxdyH5YSZkz17QCt4JdiOZCSQ1q2rMzB1qVMOCbNR I5nB8yJngVkqFQ0m0cM1aeW7k/TCnlwxs6zGzBf8M3Mtpbkc4x46pkvVBcn/vY5keu6Q yrng== 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 a12si2650584pll.112.2019.02.11.18.14.23; Mon, 11 Feb 2019 18:14:39 -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 S1728116AbfBLCNj (ORCPT + 99 others); Mon, 11 Feb 2019 21:13:39 -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 S1727804AbfBLCM7 (ORCPT ); Mon, 11 Feb 2019 21:12:59 -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:12:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,361,1544515200"; d="scan'208";a="146057859" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga001.fm.intel.com with ESMTP; 11 Feb 2019 18:12:57 -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 5/6] x86, mm: skip 1G range if the range doesn't span PUD Date: Tue, 12 Feb 2019 10:12:14 +0800 Message-Id: <20190212021215.13247-6-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 If the 1G aligned pfn exceed the range, we are sure there won't be possible 1G range. so we can just jump to split 2M range directly. Signed-off-by: Wei Yang --- arch/x86/mm/init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 87275238dbb0..cbb105388f24 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -394,10 +394,10 @@ static int __meminit split_mem_range(struct map_range *mr, * Range (B): * big page (2M) range */ - start_pfn = round_up(pfn, PFN_DOWN(PMD_SIZE)); end_pfn = round_up(pfn, PFN_DOWN(PUD_SIZE)); if (end_pfn > round_down(limit_pfn, PFN_DOWN(PMD_SIZE))) - end_pfn = round_down(limit_pfn, PFN_DOWN(PMD_SIZE)); + goto no_1G_range; + start_pfn = round_up(pfn, PFN_DOWN(PMD_SIZE)); if (start_pfn < end_pfn) { nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, page_size_mask & (1<