Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634407

Re: [PATCH] x86/mm: trivial code cleanup for memory_map_top_doown()

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Wei Yang <richard.weiyang@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/mm: trivial code cleanup for memory_map_top_doown()
Date Tue, 02 May 2017 15:30:02 +0200
Message-ID <tCG2m-7dm-3@gated-at.bofh.it> (permalink)
References <tbRRv-5tj-7@gated-at.bofh.it> <tkDmh-4GD-9@gated-at.bofh.it> <tkLMR-2GV-1@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VqhivwOfXamDcPrEDx/a6aT6kY5R/icBaPrq1b+7AGA=; b=QQoPxSnXbZ86lUs00hrZ+SfgD8h+/nG7EuufZ+/qhkR/Z2Th6mNJZjp/W75+7r7c2O 8O9Su4DAou12YCsRVytHXsTzuWNUv+c1Nd4VwoEO6AfQUfoaPsVVTzUV43jma31GcyMM VOgWKkQ26vonxqiWp3uZuD06F4zfytqZKyFUYiAfL0rcmvKAsB7FcKXw0+Tw/qWy14zF +JMuPLt2ZCG5Y5tUNySpp3zHxl8xIxvXX/1VG/nZ/3+gA1BCgO1rTHgYpLHKjFGCvbWY GUjGgbLdLtep9SI4rTkTLSWiqKnA9CFMEhwm+PCguPcb2cAZc7XH3c5eputz3hMp1aP4 wf7w==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VqhivwOfXamDcPrEDx/a6aT6kY5R/icBaPrq1b+7AGA=; b=iTcNvd7MWaEkd2yoY5P96S/liPA+3bQJMFdObYiqhS+LjpAdxv2EJu2gldZ8EUVrYL wGOiAe2opyNbsisE6D4VsxE5hfLVLLR3SZWDaJbP/XG7CqMIHhyM/B3deUIF7MU9s2Iu Y5dCu7VHbUrTjqLQ09TYnV6XVbMfPc1C+BSUaWV333SX+s5v/lXtcmBrfqJl23LZ4dHh WpZvJgsyICpSRkUd8TVXmu6LcVRsyss9qDNSgNDwQXHlcsJ4kVj9BUa/e2cZwZLKRTto zQNbxGjqxR9d8S9KzygG/e8vtaT05L/BLQBX8epWvDwY64eUXyRsbmFXKLtPsx+QDcTq TeHQ==
X-Gm-Message-State AN3rC/7kDQusRzNO5nfjNJX73c07loReNFNZ1UpOBB03OlOfS1dLZz+g Q2xFIk7HFPuIwA==
X-Received by 10.84.128.99 with SMTP id 90mr41426445pla.166.1493731594493; Tue, 02 May 2017 06:26:34 -0700 (PDT)
Reply-To Wei Yang <richard.weiyang@gmail.com>
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl"
Content-Disposition inline
User-Agent Mutt/1.7.2 (2016-11-26)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 88
Organization linux.* mail to news gateway
X-Original-Cc Borislav Petkov <bp@alien8.de>, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Tue, 2 May 2017 21:26:31 +0800
X-Original-Message-ID <20170502132631.GA7654@WeideMacBook-Pro.local>
X-Original-References <20170217143033.95412-1-richard.weiyang@gmail.com> <20170313185021.oxl3ybuiiuqnyg5e@pd.tnic> <20170314035639.GA30208@WeideMacBook-Pro.local>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1634407

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi, Borislav and all

Do you agree with my analysis or you have other comments?

On Tue, Mar 14, 2017 at 11:56:39AM +0800, Wei Yang wrote:
>On Mon, Mar 13, 2017 at 07:50:21PM +0100, Borislav Petkov wrote:
>>On Fri, Feb 17, 2017 at 10:30:33PM +0800, Wei Yang wrote:
>>> In case (last_start <= step_size), start is for sure to be 0. So, it is
>>
>
>Hmm, I may write it more specific:
>
>"start" is for sure to be set to 0 with round_down(last_start - 1, step_size).
>
>>Well, lemme see:
>>
>>[    0.000000] memory_map_top_down: entry, [0x100000:0x7ffdf000)
>>[    0.000000] memory_map_top_down: addr: 0x7fc00000, real_end: 0x7fe00000
>>[    0.000000] memory_map_top_down: last_start: 0x40000000 <= step_size: 0x2000000000, start: 0x40000000
>>											      ^^^^^^^^^^
>>It doesn't look like 0 to me.
>>
>>---
>>diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
>>index 2193799ca800..d3b02a416df3 100644
>>--- a/arch/x86/mm/init.c
>>+++ b/arch/x86/mm/init.c
>>@@ -527,8 +531,13 @@ static void __init memory_map_top_down(unsigned long map_start,
>> 			start = round_down(last_start - 1, step_size);
>> 			if (start < map_start)
>> 				start = map_start;
>>-		} else
>>+		} else {
>>+			pr_info("%s: last_start: 0x%lx <= step_size: 0x%lx, start: 0x%lx\n",
>>+				__func__, last_start, step_size, start);
>>+
>
>If you change this log with the following
>
>			pr_err("%s: last_start: 0x%lx <= step_size: 0x%lx, start: 0x%lx\n",
>				__func__, last_start, step_size,
>				round_down(last_start - 1, step_size));
>
>You could see after calculation, start is 0 when (last_start <= step_size).
>
>-- 
>Wei Yang
>Help you, Help me



-- 
Wei Yang
Help you, Help me

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] x86/mm: trivial code cleanup for memory_map_top_doown() Wei Yang <richard.weiyang@gmail.com> - 2017-05-02 15:30 +0200

csiph-web