linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm: Drop useless local parameters of __register_one_node()
@ 2017-06-21  2:57 Dou Liyang
  2017-06-29 11:12 ` Michal Hocko
  2017-07-25  9:09 ` Michael Ellerman
  0 siblings, 2 replies; 6+ messages in thread
From: Dou Liyang @ 2017-06-21  2:57 UTC (permalink / raw)
  To: linux-kernel, linux-mm, akpm
  Cc: Dou Liyang, David Rientjes, Michal Hocko, isimatu.yasuaki

... initializes local parameters "p_node" & "parent" for
register_node().

But, register_node() does not use them.

Remove the related code of "parent" node, cleanup __register_one_node()
and register_node().

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: isimatu.yasuaki@jp.fujitsu.com
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
---
V1 --> V2:
Rebase it on 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm

 drivers/base/node.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index 73d39bc..d8dc830 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -288,7 +288,7 @@ static void node_device_release(struct device *dev)
  *
  * Initialize and register the node device.
  */
-static int register_node(struct node *node, int num, struct node *parent)
+static int register_node(struct node *node, int num)
 {
 	int error;
 
@@ -567,19 +567,14 @@ static void init_node_hugetlb_work(int nid) { }
 
 int __register_one_node(int nid)
 {
-	int p_node = parent_node(nid);
-	struct node *parent = NULL;
 	int error;
 	int cpu;
 
-	if (p_node != nid)
-		parent = node_devices[p_node];
-
 	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
 	if (!node_devices[nid])
 		return -ENOMEM;
 
-	error = register_node(node_devices[nid], nid, parent);
+	error = register_node(node_devices[nid], nid);
 
 	/* link cpu under this node */
 	for_each_present_cpu(cpu) {
-- 
2.5.5

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

* Re: [PATCH v2] mm: Drop useless local parameters of __register_one_node()
  2017-06-21  2:57 [PATCH v2] mm: Drop useless local parameters of __register_one_node() Dou Liyang
@ 2017-06-29 11:12 ` Michal Hocko
  2017-06-29 11:58   ` Dou Liyang
  2017-07-25  9:09 ` Michael Ellerman
  1 sibling, 1 reply; 6+ messages in thread
From: Michal Hocko @ 2017-06-29 11:12 UTC (permalink / raw)
  To: Dou Liyang; +Cc: linux-kernel, linux-mm, akpm, David Rientjes, isimatu.yasuaki

On Wed 21-06-17 10:57:26, Dou Liyang wrote:
> ... initializes local parameters "p_node" & "parent" for
> register_node().
> 
> But, register_node() does not use them.
> 
> Remove the related code of "parent" node, cleanup __register_one_node()
> and register_node().
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: isimatu.yasuaki@jp.fujitsu.com
> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Acked-by: David Rientjes <rientjes@google.com>

I am sorry, this slipped through cracks.
Acked-by: Michal Hocko <mhocko@suse.com>

> ---
> V1 --> V2:
> Rebase it on 
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
> 
>  drivers/base/node.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index 73d39bc..d8dc830 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -288,7 +288,7 @@ static void node_device_release(struct device *dev)
>   *
>   * Initialize and register the node device.
>   */
> -static int register_node(struct node *node, int num, struct node *parent)
> +static int register_node(struct node *node, int num)
>  {
>  	int error;
>  
> @@ -567,19 +567,14 @@ static void init_node_hugetlb_work(int nid) { }
>  
>  int __register_one_node(int nid)
>  {
> -	int p_node = parent_node(nid);
> -	struct node *parent = NULL;
>  	int error;
>  	int cpu;
>  
> -	if (p_node != nid)
> -		parent = node_devices[p_node];
> -
>  	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
>  	if (!node_devices[nid])
>  		return -ENOMEM;
>  
> -	error = register_node(node_devices[nid], nid, parent);
> +	error = register_node(node_devices[nid], nid);
>  
>  	/* link cpu under this node */
>  	for_each_present_cpu(cpu) {
> -- 
> 2.5.5
> 
> 
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Michal Hocko
SUSE Labs

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

* Re: [PATCH v2] mm: Drop useless local parameters of __register_one_node()
  2017-06-29 11:12 ` Michal Hocko
@ 2017-06-29 11:58   ` Dou Liyang
  2017-06-29 12:11     ` Michal Hocko
  0 siblings, 1 reply; 6+ messages in thread
From: Dou Liyang @ 2017-06-29 11:58 UTC (permalink / raw)
  To: Michal Hocko
  Cc: linux-kernel, linux-mm, akpm, David Rientjes, isimatu.yasuaki

Hi Michal,

At 06/29/2017 07:12 PM, Michal Hocko wrote:
> On Wed 21-06-17 10:57:26, Dou Liyang wrote:
>> ... initializes local parameters "p_node" & "parent" for
>> register_node().
>>
>> But, register_node() does not use them.
>>
>> Remove the related code of "parent" node, cleanup __register_one_node()
>> and register_node().
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: David Rientjes <rientjes@google.com>
>> Cc: Michal Hocko <mhocko@kernel.org>
>> Cc: isimatu.yasuaki@jp.fujitsu.com
>> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
>> Acked-by: David Rientjes <rientjes@google.com>
>
> I am sorry, this slipped through cracks.
> Acked-by: Michal Hocko <mhocko@suse.com>

Thanks for your Acked-by, but this patch has been added to the -mm tree. 
  Its filename is
    mm-drop-useless-local-parameters-of-__register_one_node.patch

This patch should soon appear at
 
http://ozlabs.org/~akpm/mmots/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch
and later at
 
http://ozlabs.org/~akpm/mmotm/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch

I don't know what should I do next ? :)

Thanks,
	dou.
>
>> ---
>> V1 --> V2:
>> Rebase it on
>> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
>>
>>  drivers/base/node.c | 9 ++-------
>>  1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/base/node.c b/drivers/base/node.c
>> index 73d39bc..d8dc830 100644
>> --- a/drivers/base/node.c
>> +++ b/drivers/base/node.c
>> @@ -288,7 +288,7 @@ static void node_device_release(struct device *dev)
>>   *
>>   * Initialize and register the node device.
>>   */
>> -static int register_node(struct node *node, int num, struct node *parent)
>> +static int register_node(struct node *node, int num)
>>  {
>>  	int error;
>>
>> @@ -567,19 +567,14 @@ static void init_node_hugetlb_work(int nid) { }
>>
>>  int __register_one_node(int nid)
>>  {
>> -	int p_node = parent_node(nid);
>> -	struct node *parent = NULL;
>>  	int error;
>>  	int cpu;
>>
>> -	if (p_node != nid)
>> -		parent = node_devices[p_node];
>> -
>>  	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
>>  	if (!node_devices[nid])
>>  		return -ENOMEM;
>>
>> -	error = register_node(node_devices[nid], nid, parent);
>> +	error = register_node(node_devices[nid], nid);
>>
>>  	/* link cpu under this node */
>>  	for_each_present_cpu(cpu) {
>> --
>> 2.5.5
>>
>>
>>
>> --
>> To unsubscribe, send a message with 'unsubscribe linux-mm' in
>> the body to majordomo@kvack.org.  For more info on Linux MM,
>> see: http://www.linux-mm.org/ .
>> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>

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

* Re: [PATCH v2] mm: Drop useless local parameters of __register_one_node()
  2017-06-29 11:58   ` Dou Liyang
@ 2017-06-29 12:11     ` Michal Hocko
  0 siblings, 0 replies; 6+ messages in thread
From: Michal Hocko @ 2017-06-29 12:11 UTC (permalink / raw)
  To: Dou Liyang; +Cc: linux-kernel, linux-mm, akpm, David Rientjes, isimatu.yasuaki

On Thu 29-06-17 19:58:52, Dou Liyang wrote:
> Hi Michal,
> 
> At 06/29/2017 07:12 PM, Michal Hocko wrote:
> >On Wed 21-06-17 10:57:26, Dou Liyang wrote:
> >>... initializes local parameters "p_node" & "parent" for
> >>register_node().
> >>
> >>But, register_node() does not use them.
> >>
> >>Remove the related code of "parent" node, cleanup __register_one_node()
> >>and register_node().
> >>
> >>Cc: Andrew Morton <akpm@linux-foundation.org>
> >>Cc: David Rientjes <rientjes@google.com>
> >>Cc: Michal Hocko <mhocko@kernel.org>
> >>Cc: isimatu.yasuaki@jp.fujitsu.com
> >>Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
> >>Acked-by: David Rientjes <rientjes@google.com>
> >
> >I am sorry, this slipped through cracks.
> >Acked-by: Michal Hocko <mhocko@suse.com>
> 
> Thanks for your Acked-by, but this patch has been added to the -mm tree.
> Its filename is
>    mm-drop-useless-local-parameters-of-__register_one_node.patch

Yeah, don't worry. Andrew will add the acked-by in his tree.

> This patch should soon appear at
> 
> http://ozlabs.org/~akpm/mmots/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch
> and later at
> 
> http://ozlabs.org/~akpm/mmotm/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch
> 
> I don't know what should I do next ? :)

Wait for Andrew to send this to Linus during the next merge window.
-- 
Michal Hocko
SUSE Labs

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

* Re: [PATCH v2] mm: Drop useless local parameters of __register_one_node()
  2017-06-21  2:57 [PATCH v2] mm: Drop useless local parameters of __register_one_node() Dou Liyang
  2017-06-29 11:12 ` Michal Hocko
@ 2017-07-25  9:09 ` Michael Ellerman
  2017-07-25 11:15   ` Dou Liyang
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2017-07-25  9:09 UTC (permalink / raw)
  To: Dou Liyang, linux-kernel, linux-mm, akpm
  Cc: Dou Liyang, David Rientjes, Michal Hocko, isimatu.yasuaki

Dou Liyang <douly.fnst@cn.fujitsu.com> writes:

> ... initializes local parameters "p_node" & "parent" for
> register_node().
>
> But, register_node() does not use them.
>
> Remove the related code of "parent" node, cleanup __register_one_node()
> and register_node().
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: isimatu.yasuaki@jp.fujitsu.com
> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Acked-by: David Rientjes <rientjes@google.com>
> ---
> V1 --> V2:
> Rebase it on 
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
>
>  drivers/base/node.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)

That appears to be the last user of parent_node().

Can we start removing it from the topology.h headers for each arch?

cheers

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

* Re: [PATCH v2] mm: Drop useless local parameters of __register_one_node()
  2017-07-25  9:09 ` Michael Ellerman
@ 2017-07-25 11:15   ` Dou Liyang
  0 siblings, 0 replies; 6+ messages in thread
From: Dou Liyang @ 2017-07-25 11:15 UTC (permalink / raw)
  To: Michael Ellerman, linux-kernel, linux-mm, akpm
  Cc: David Rientjes, Michal Hocko, isimatu.yasuaki

Hi Michael,

At 07/25/2017 05:09 PM, Michael Ellerman wrote:
> Dou Liyang <douly.fnst@cn.fujitsu.com> writes:
>
>> ... initializes local parameters "p_node" & "parent" for
>> register_node().
>>
>> But, register_node() does not use them.
>>
>> Remove the related code of "parent" node, cleanup __register_one_node()
>> and register_node().
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: David Rientjes <rientjes@google.com>
>> Cc: Michal Hocko <mhocko@kernel.org>
>> Cc: isimatu.yasuaki@jp.fujitsu.com
>> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
>> Acked-by: David Rientjes <rientjes@google.com>
>> ---
>> V1 --> V2:
>> Rebase it on
>> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
>>
>>  drivers/base/node.c | 9 ++-------
>>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> That appears to be the last user of parent_node().

Oops, yes, it is the last one.

>
> Can we start removing it from the topology.h headers for each arch?
>

Yes, I think so.

Thanks,
	dou.

> cheers
>
>
>

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

end of thread, other threads:[~2017-07-25 11:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-21  2:57 [PATCH v2] mm: Drop useless local parameters of __register_one_node() Dou Liyang
2017-06-29 11:12 ` Michal Hocko
2017-06-29 11:58   ` Dou Liyang
2017-06-29 12:11     ` Michal Hocko
2017-07-25  9:09 ` Michael Ellerman
2017-07-25 11:15   ` Dou Liyang

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).