linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, memory_hotplug: pass next_memory_node to new_page_nodemask()
@ 2018-12-13  3:27 Wei Yang
  2018-12-13  4:03 ` Wei Yang
  2018-12-13 20:10 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yang @ 2018-12-13  3:27 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, mhocko, osalvador, david, Wei Yang

As the document says new_page_nodemask() will try to allocate from a
different node, but current behavior just do the opposite by passing
current nid as preferred_nid to new_page_nodemask().

This patch pass next_memory_node as preferred_nid to new_page_nodemask()
to fix it.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/memory_hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 6910e0eea074..0c075aac0a81 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1335,7 +1335,7 @@ static struct page *new_node_page(struct page *page, unsigned long private)
 	if (nodes_empty(nmask))
 		node_set(nid, nmask);
 
-	return new_page_nodemask(page, nid, &nmask);
+	return new_page_nodemask(page, next_memory_node(nid), &nmask);
 }
 
 #define NR_OFFLINE_AT_ONCE_PAGES	(256)
-- 
2.15.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm, memory_hotplug: pass next_memory_node to new_page_nodemask()
  2018-12-13  3:27 [PATCH] mm, memory_hotplug: pass next_memory_node to new_page_nodemask() Wei Yang
@ 2018-12-13  4:03 ` Wei Yang
  2018-12-13 20:10 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Wei Yang @ 2018-12-13  4:03 UTC (permalink / raw)
  To: Wei Yang; +Cc: linux-mm, akpm, mhocko, osalvador, david

On Thu, Dec 13, 2018 at 11:27:44AM +0800, Wei Yang wrote:
>As the document says new_page_nodemask() will try to allocate from a
>different node, but current behavior just do the opposite by passing
>current nid as preferred_nid to new_page_nodemask().
>

Hmm... my understanding is not correct.

Sorry for the broadcasting.

>This patch pass next_memory_node as preferred_nid to new_page_nodemask()
>to fix it.
>
>Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>---
> mm/memory_hotplug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>index 6910e0eea074..0c075aac0a81 100644
>--- a/mm/memory_hotplug.c
>+++ b/mm/memory_hotplug.c
>@@ -1335,7 +1335,7 @@ static struct page *new_node_page(struct page *page, unsigned long private)
> 	if (nodes_empty(nmask))
> 		node_set(nid, nmask);
> 
>-	return new_page_nodemask(page, nid, &nmask);
>+	return new_page_nodemask(page, next_memory_node(nid), &nmask);
> }
> 
> #define NR_OFFLINE_AT_ONCE_PAGES	(256)
>-- 
>2.15.1

-- 
Wei Yang
Help you, Help me

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm, memory_hotplug: pass next_memory_node to new_page_nodemask()
  2018-12-13  3:27 [PATCH] mm, memory_hotplug: pass next_memory_node to new_page_nodemask() Wei Yang
  2018-12-13  4:03 ` Wei Yang
@ 2018-12-13 20:10 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2018-12-13 20:10 UTC (permalink / raw)
  To: Wei Yang; +Cc: kbuild-all, linux-mm, akpm, mhocko, osalvador, david

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

Hi Wei,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.20-rc6 next-20181213]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Wei-Yang/mm-memory_hotplug-pass-next_memory_node-to-new_page_nodemask/20181214-030950
config: x86_64-randconfig-x009-201849 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   mm/memory_hotplug.c: In function 'new_node_page':
>> mm/memory_hotplug.c:1339:33: error: implicit declaration of function 'next_memory_node'; did you mean 'first_memory_node'? [-Werror=implicit-function-declaration]
     return new_page_nodemask(page, next_memory_node(nid), &nmask);
                                    ^~~~~~~~~~~~~~~~
                                    first_memory_node
   cc1: some warnings being treated as errors

vim +1339 mm/memory_hotplug.c

  1324	
  1325	static struct page *new_node_page(struct page *page, unsigned long private)
  1326	{
  1327		int nid = page_to_nid(page);
  1328		nodemask_t nmask = node_states[N_MEMORY];
  1329	
  1330		/*
  1331		 * try to allocate from a different node but reuse this node if there
  1332		 * are no other online nodes to be used (e.g. we are offlining a part
  1333		 * of the only existing node)
  1334		 */
  1335		node_clear(nid, nmask);
  1336		if (nodes_empty(nmask))
  1337			node_set(nid, nmask);
  1338	
> 1339		return new_page_nodemask(page, next_memory_node(nid), &nmask);
  1340	}
  1341	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26734 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-13 20:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13  3:27 [PATCH] mm, memory_hotplug: pass next_memory_node to new_page_nodemask() Wei Yang
2018-12-13  4:03 ` Wei Yang
2018-12-13 20:10 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox