linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yunfeng Ye <yeyunfeng@huawei.com>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: <rppt@linux.ibm.com>, <akpm@linux-foundation.org>,
	<osalvador@suse.de>, <mhocko@suse.co>, <dan.j.williams@intel.com>,
	<david@redhat.com>, <cai@lca.pw>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: Support memblock alloc on the exact node for sparse_buffer_init()
Date: Thu, 19 Sep 2019 19:33:46 +0800	[thread overview]
Message-ID: <b06c114c-450c-8d75-0f45-0bd314e1bf5a@huawei.com> (raw)
In-Reply-To: <20190919003047.GA20697@richard>



On 2019/9/19 8:30, Wei Yang wrote:
> On Wed, Sep 18, 2019 at 03:08:41PM +0800, Yunfeng Ye wrote:
>>
>>
>> On 2019/9/18 14:51, Wei Yang wrote:
>>> On Wed, Sep 18, 2019 at 12:22:29PM +0800, Yunfeng Ye wrote:
>>>> Currently, when memblock_find_in_range_node() fail on the exact node, it
>>>> will use %NUMA_NO_NODE to find memblock from other nodes. At present,
>>>> the work is good, but when the large memory is insufficient and the
>>>> small memory is enough, we want to allocate the small memory of this
>>>> node first, and do not need to allocate large memory from other nodes.
>>>>
>>>> In sparse_buffer_init(), it will prepare large chunks of memory for page
>>>> structure. The page management structure requires a lot of memory, but
>>>> if the node does not have enough memory, it can be converted to a small
>>>> memory allocation without having to allocate it from other nodes.
>>>>
>>>> Add %MEMBLOCK_ALLOC_EXACT_NODE flag for this situation. Normally, the
>>>> behavior is the same with %MEMBLOCK_ALLOC_ACCESSIBLE, only that it will
>>>> not allocate from other nodes when a single node fails to allocate.
>>>>
>>>> If large contiguous block memory allocated fail in sparse_buffer_init(),
>>>> it will allocates small block memmory section by section later.
>>>>
>>>
>>> Looks this changes current behavior even it fall back to section based
>>> allocation.
>>>
>> When fall back to section allocation, it still use %MEMBLOCK_ALLOC_ACCESSIBLE
>> ,I think the behavior is not change, Can you tell me the detail about the
>> changes. thanks.
>>
> 
> You pass MEMBLOCK_ALLOC_EXACT_NODE for the first round allocation, which
> forbid it allocates from other node. This is different from current behavior.
> Am I right?
> 
Most cases, it will not go to the %MEMBLOCK_ALLOC_EXACT_NODE allocate routine.
so the behavior will not change.
If current node have no large contiguous block memory, it will fall back to
allocate memory based section. this is the different from current behavior.

thanks.
> .
> 


  reply	other threads:[~2019-09-19 11:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  4:22 [PATCH] mm: Support memblock alloc on the exact node for sparse_buffer_init() Yunfeng Ye
2019-09-18  6:51 ` Wei Yang
2019-09-18  7:08   ` Yunfeng Ye
2019-09-19  0:30     ` Wei Yang
2019-09-19 11:33       ` Yunfeng Ye [this message]
2019-09-19  4:47 ` Mike Rapoport
2019-09-19  7:14   ` Yunfeng Ye
2019-09-19  9:28     ` Mike Rapoport
2019-09-19 11:43       ` Yunfeng Ye

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=b06c114c-450c-8d75-0f45-0bd314e1bf5a@huawei.com \
    --to=yeyunfeng@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.co \
    --cc=osalvador@suse.de \
    --cc=richardw.yang@linux.intel.com \
    --cc=rppt@linux.ibm.com \
    /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).