linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: <iamjoonsoo.kim@lge.com>, <mgorman@techsingularity.net>,
	<minchan@kernel.org>, <vbabka@suse.cz>,
	<akpm@linux-foundation.org>, <linux-kernel@vger.kernel.org>,
	<linux-mm@kvack.org>
Subject: Re: [RESEND] x86/numa: move setting parsed numa node to num_add_memblk
Date: Tue, 12 Dec 2017 14:52:26 +0800	[thread overview]
Message-ID: <5A2F7CAA.3070405@huawei.com> (raw)
In-Reply-To: <20171211134539.GF4779@dhcp22.suse.cz>

On 2017/12/11 21:45, Michal Hocko wrote:
> On Mon 11-12-17 20:59:29, zhong jiang wrote:
>> On 2017/12/11 20:03, Michal Hocko wrote:
>>> On Fri 01-12-17 18:13:52, zhong jiang wrote:
>>>> The acpi table are very much like user input. it is likely to
>>>> introduce some unreasonable node in some architecture. but
>>>> they do not ingore the node and bail out in time. it will result
>>>> in unnecessary print.
>>>> e.g  x86:  start is equal to end is a unreasonable node.
>>>> numa_blk_memblk will fails but return 0.
>>>>
>>>> meanwhile, Arm64 node will double set it to "numa_node_parsed"
>>>> after NUMA adds a memblk successfully.  but X86 is not. because
>>>> numa_add_memblk is not set in X86.
>>> I am sorry but I still fail to understand wht the actual problem is.
>>> You said that x86 will print a message. Alright at least you know that
>>> the platform provides a nonsense ACPI/SRAT? tables and you can complain.
>>> But does the kernel misbehave? In what way?
>>   From the view of  the following code , we should expect that the node is reasonable.
>>   otherwise, if we only want to complain,  it should bail out in time after printing the
>>   unreasonable message.
>>
>>           node_set(node, numa_nodes_parsed);
>>
>>         pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n",
>>                 node, pxm,
>>                 (unsigned long long) start, (unsigned long long) end - 1,
>>                 hotpluggable ? " hotplug" : "",
>>                 ma->flags & ACPI_SRAT_MEM_NON_VOLATILE ? " non-volatile" : "");
>>
>>         /* Mark hotplug range in memblock. */
>>         if (hotpluggable && memblock_mark_hotplug(start, ma->length))
>>                 pr_warn("SRAT: Failed to mark hotplug range [mem %#010Lx-%#010Lx] in memblock\n",
>>                         (unsigned long long)start, (unsigned long long)end - 1);
>>
>>         max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1));
>>
>>         return 0;
>> out_err_bad_srat:
>>         bad_srat();
>>
>>  In addition.  Arm64  will double set node to numa_nodes_parsed after add a memblk
>> successfully.  Because numa_add_memblk will perform node_set(*, *).
>>
>>          if (numa_add_memblk(node, start, end) < 0) {
>>                 pr_err("SRAT: Failed to add memblk to node %u [mem %#010Lx-%#010Lx]\n",
>>                        node, (unsigned long long) start,
>>                        (unsigned long long) end - 1);
>>                 goto out_err_bad_srat;
>>         }
>>
>>         node_set(node, numa_nodes_parsed);
> I am sorry but I _do not_ understand how this answers my simple
> question. You are describing the code flow which doesn't really explain
> what is the _user_ or a _runtime_ visible effect. Anybody reading this
> changelog will have to scratch his head to understand what the heck does
> this fix and whether the patch needs to be considered for backporting.
> See my point?
 There  is not any visible effect to the user.  IMO,  it is  a better optimization.
 Maybe I put more words  to explain  how  the patch works.  :-[

 I found the code is messy when reading it without a real issue. 

 Thanks
 zhong jiang
 

      reply	other threads:[~2017-12-12  6:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 10:13 [RESEND] x86/numa: move setting parsed numa node to num_add_memblk zhong jiang
2017-12-11 12:03 ` Michal Hocko
2017-12-11 12:59   ` zhong jiang
2017-12-11 13:45     ` Michal Hocko
2017-12-12  6:52       ` zhong jiang [this message]

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=5A2F7CAA.3070405@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=vbabka@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).