mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] memory hotadd fixes [2/5] change find_next_system_ram's return value manner
@ 2006-08-03  3:33 KAMEZAWA Hiroyuki
  2006-08-04  0:05 ` keith mannthey
  0 siblings, 1 reply; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2006-08-03  3:33 UTC (permalink / raw)
  To: LKML; +Cc: LHMS, kmannth, y-goto, Andrew Morton

find_next_system_ram() returns valid memory range which meets requested
area, only used by memory-hot-add.
This function always rewrite requested resource even if returned area is
not fully fit in requested one. And sometimes the returnd resource is larger
than requested area. This annoyes the caller.
This patch changes the returned value to fit in requested area.

Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

 kernel/resource.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.18-rc3/kernel/resource.c
===================================================================
--- linux-2.6.18-rc3.orig/kernel/resource.c	2006-08-01 16:11:56.000000000 +0900
+++ linux-2.6.18-rc3/kernel/resource.c	2006-08-01 16:38:45.000000000 +0900
@@ -261,8 +261,10 @@
 	if (!p)
 		return -1;
 	/* copy data */
-	res->start = p->start;
-	res->end = p->end;
+	if (res->start < p->start)
+		res->start = p->start;
+	if (res->end > p->end)
+		res->end = p->end;
 	return 0;
 }
 #endif


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

* Re: [PATCH] memory hotadd fixes [2/5] change find_next_system_ram's return value manner
  2006-08-03  3:33 [PATCH] memory hotadd fixes [2/5] change find_next_system_ram's return value manner KAMEZAWA Hiroyuki
@ 2006-08-04  0:05 ` keith mannthey
  0 siblings, 0 replies; 2+ messages in thread
From: keith mannthey @ 2006-08-04  0:05 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki; +Cc: lkml, lhms-devel, y-goto, Andrew Morton

On Thu, 2006-08-03 at 12:33 +0900, KAMEZAWA Hiroyuki wrote:
> find_next_system_ram() returns valid memory range which meets requested
> area, only used by memory-hot-add.
> This function always rewrite requested resource even if returned area is
> not fully fit in requested one. And sometimes the returnd resource is larger
> than requested area. This annoyes the caller.
> This patch changes the returned value to fit in requested area.
> 
> Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> 
>  kernel/resource.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.18-rc3/kernel/resource.c
> ===================================================================
> --- linux-2.6.18-rc3.orig/kernel/resource.c	2006-08-01 16:11:56.000000000 +0900
> +++ linux-2.6.18-rc3/kernel/resource.c	2006-08-01 16:38:45.000000000 +0900
> @@ -261,8 +261,10 @@
>  	if (!p)
>  		return -1;
>  	/* copy data */
> -	res->start = p->start;
> -	res->end = p->end;
> +	if (res->start < p->start)
> +		res->start = p->start;
> +	if (res->end > p->end)
> +		res->end = p->end;
>  	return 0;
>  }
>  #endif


This is a needed fix for me.  It looks and works great on x86_64. 

Acked-By: Keith Mannthey <kmannth@us.ibm.com>


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

end of thread, other threads:[~2006-08-04  0:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-03  3:33 [PATCH] memory hotadd fixes [2/5] change find_next_system_ram's return value manner KAMEZAWA Hiroyuki
2006-08-04  0:05 ` keith mannthey

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

Powered by JetHome