linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bootfix] pass used_node_mask by reference in 2.6.10-mm1
@ 2005-01-03 19:13 William Lee Irwin III
  2005-01-03 19:50 ` William Lee Irwin III
  0 siblings, 1 reply; 4+ messages in thread
From: William Lee Irwin III @ 2005-01-03 19:13 UTC (permalink / raw)
  To: jbarnes; +Cc: akpm, linux-kernel

Without passing this parameter by reference, the changes to used_node_mask
are meaningless and do not affect the caller's copy.

This leads to boot-time failure. This proposed fix passes it by reference.


-- wli

Signed-off-by: William Irwin <wli@holomorphy.com>


Index: mm1-2.6.10/mm/page_alloc.c
===================================================================
--- mm1-2.6.10.orig/mm/page_alloc.c	2005-01-03 10:37:58.000000000 -0800
+++ mm1-2.6.10/mm/page_alloc.c	2005-01-03 10:44:01.000000000 -0800
@@ -1377,7 +1377,7 @@
  * on them otherwise.
  * It returns -1 if no node is found.
  */
-static int __init find_next_best_node(int node, nodemask_t used_node_mask)
+static int __init find_next_best_node(int node, nodemask_t *used_node_mask)
 {
 	int i, n, val;
 	int min_val = INT_MAX;
@@ -1390,11 +1390,11 @@
 		n = (node+i) % num_online_nodes();
 
 		/* Don't want a node to appear more than once */
-		if (node_isset(n, used_node_mask))
+		if (node_isset(n, *used_node_mask))
 			continue;
 
 		/* Use the local node if we haven't already */
-		if (!node_isset(node, used_node_mask)) {
+		if (!node_isset(node, *used_node_mask)) {
 			best_node = node;
 			break;
 		}
@@ -1418,7 +1418,7 @@
 	}
 
 	if (best_node >= 0)
-		node_set(best_node, used_node_mask);
+		node_set(best_node, *used_node_mask);
 
 	return best_node;
 }
@@ -1442,7 +1442,7 @@
 	load = num_online_nodes();
 	prev_node = local_node;
 	nodes_clear(used_mask);
-	while ((node = find_next_best_node(local_node, used_mask)) >= 0) {
+	while ((node = find_next_best_node(local_node, &used_mask)) >= 0) {
 		/*
 		 * We don't want to pressure a particular node.
 		 * So adding penalty to the first node in same

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

* Re: [bootfix] pass used_node_mask by reference in 2.6.10-mm1
  2005-01-03 19:13 [bootfix] pass used_node_mask by reference in 2.6.10-mm1 William Lee Irwin III
@ 2005-01-03 19:50 ` William Lee Irwin III
  2005-01-03 20:44   ` Jesse Barnes
  0 siblings, 1 reply; 4+ messages in thread
From: William Lee Irwin III @ 2005-01-03 19:50 UTC (permalink / raw)
  To: jbarnes; +Cc: akpm, linux-kernel

On Mon, Jan 03, 2005 at 11:13:19AM -0800, William Lee Irwin III wrote:
> Without passing this parameter by reference, the changes to used_node_mask
> are meaningless and do not affect the caller's copy.
> This leads to boot-time failure. This proposed fix passes it by reference.

This proposed fix is an actual fix according to my own testing.

Without the patch applied, my quad em64t does not boot, and livelocks
prior to console_init().

With the patch applied, my quad em64 boots and runs normally.


-- wli

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

* Re: [bootfix] pass used_node_mask by reference in 2.6.10-mm1
  2005-01-03 19:50 ` William Lee Irwin III
@ 2005-01-03 20:44   ` Jesse Barnes
  2005-01-07  1:06     ` Matthew Dobson
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Barnes @ 2005-01-03 20:44 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: akpm, linux-kernel

On Monday, January 3, 2005 11:50 am, William Lee Irwin III wrote:
> On Mon, Jan 03, 2005 at 11:13:19AM -0800, William Lee Irwin III wrote:
> > Without passing this parameter by reference, the changes to
> > used_node_mask are meaningless and do not affect the caller's copy.
> > This leads to boot-time failure. This proposed fix passes it by
> > reference.
>
> This proposed fix is an actual fix according to my own testing.
>
> Without the patch applied, my quad em64t does not boot, and livelocks
> prior to console_init().
>
> With the patch applied, my quad em64 boots and runs normally.

Makes my Altix boot as well.  Thanks for the fix.

Jesse

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

* Re: [bootfix] pass used_node_mask by reference in 2.6.10-mm1
  2005-01-03 20:44   ` Jesse Barnes
@ 2005-01-07  1:06     ` Matthew Dobson
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Dobson @ 2005-01-07  1:06 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: William Lee Irwin III, Andrew Morton, LKML

On Mon, 2005-01-03 at 12:44, Jesse Barnes wrote:
> On Monday, January 3, 2005 11:50 am, William Lee Irwin III wrote:
> > On Mon, Jan 03, 2005 at 11:13:19AM -0800, William Lee Irwin III wrote:
> > > Without passing this parameter by reference, the changes to
> > > used_node_mask are meaningless and do not affect the caller's copy.
> > > This leads to boot-time failure. This proposed fix passes it by
> > > reference.
> >
> > This proposed fix is an actual fix according to my own testing.
> >
> > Without the patch applied, my quad em64t does not boot, and livelocks
> > prior to console_init().
> >
> > With the patch applied, my quad em64 boots and runs normally.
> 
> Makes my Altix boot as well.  Thanks for the fix.
> 
> Jesse

Yep.  Thanks for that, Bill!  That was pretty stupid of me, although I
did manage to get a couple machines over here to boot with the broken
code...?

-Matt


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

end of thread, other threads:[~2005-01-07  1:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-03 19:13 [bootfix] pass used_node_mask by reference in 2.6.10-mm1 William Lee Irwin III
2005-01-03 19:50 ` William Lee Irwin III
2005-01-03 20:44   ` Jesse Barnes
2005-01-07  1:06     ` Matthew Dobson

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