[SSI] openssi/kernel/cluster/ssi/mosixll balance.c, 1.15, 1.16 load.c, 1.9, 1.10

Roger Tsang <[email protected]> Mon, 25 Oct 2010 04:53:05 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/mosixll
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv754/cluster/ssi/mosixll

Modified Files:
      Tag: OPENSSI-FC
	balance.c load.c 
Log Message:
VPROC:
- In ssi_do_execve() optimize away is_loadlevelable() when the chosen node is the current node.

VPROC (#ifdef REXEC_LOADTABLE_FAST):
- In __ssi_do_execve() retry on -EREMOTE. There could be other nodes in cluster that are available.
- Rename __ssi_do_execve() to __ssi_choose_node().
- Convert rexec_loadtable[] array to rexec_loadmap Linux bitmap.
- Do lockless rexec_loadmap update. Reduce contention in exec_balance(), rexecve(2) and execve(2).
- Remove redundant altload() calculations since the results only change during loadinfo_received() or nm_master_send(). Evaluate altload() and store result in altload element in loadinfo structure.

 cluster/ssi/mosixll/balance.c    |   19 +++++
 cluster/ssi/mosixll/load.c       |   13 +++
 cluster/ssi/util/load_level.c    |   78 +++++++++++++----------
 fs/exec.c                        |  102 +++++++++++++++++++------------
 include/cluster/ssi/load_level.h |    7 +-
 5 files changed, 144 insertions(+), 75 deletions(-)


Index: load.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/mosixll/load.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- load.c	18 Nov 2009 06:16:53 -0000	1.9
+++ load.c	25 Oct 2010 04:53:03 -0000	1.10
@@ -105,6 +105,11 @@
 #ifdef DEBUG
 	static int display_counter = 0;
 #endif
+#ifdef REXEC_LOADTABLE_FAST
+	unsigned long new_altload;
+
+extern int altload(int, int, int);
+#endif
 
 	/* Disable interrupt to prevent mosix_snap_load() */
 	spin_lock_irqsave(&snap_load_lock, flags);
@@ -161,15 +166,21 @@
 	}
 #endif /* DEBUG */
 
+#ifdef REXEC_LOADTABLE_FAST
+	new_altload = altload(new_expload, loadinfo[0].speed, loadinfo[0].ncpus);
+#endif
 	write_lock_bh(&loadinfo_lock);
 
-	loadinfo[0].mem = latest_free_mem;
+#ifdef REXEC_LOADTABLE_FAST
+	loadinfo[0].altload = new_altload;
+#endif
 #ifdef CONFIG_SSI_LOADINFO_RLOAD
 	/* SSI_XXX: newload already factored in load_left - aka. rload */
 	loadinfo[0].load = newload - loadinfo[0].rload;
 #else
 	loadinfo[0].load = newload;
 #endif
+	loadinfo[0].mem = latest_free_mem;
 	export_load = new_expload;
 	load_left = 0;
 	write_unlock_bh(&loadinfo_lock);

Index: balance.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/mosixll/balance.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- balance.c	13 Feb 2010 14:54:38 -0000	1.15
+++ balance.c	25 Oct 2010 04:53:03 -0000	1.16
@@ -413,7 +413,12 @@
 inline unsigned long
 altload(unsigned long load, unsigned long speed, int ncpus)
 {
-	unsigned long threshold = ((unsigned long)(MF * STD_SPD)) / speed;
+	unsigned long threshold;
+
+	if (!speed || !ncpus)
+		return 0xffffffff;
+
+	threshold = ((unsigned long)(MF * STD_SPD)) / speed;
 
 	if(load <= threshold)
 		return(threshold);
@@ -691,7 +696,9 @@
 load_balance(void)
 {
 #ifdef CONFIG_SSI
+#ifndef REXEC_LOADTABLE_FAST
 	unsigned long load;
+#endif
 #else
 	register int load;
 #endif
@@ -704,10 +711,16 @@
 #endif
 
 	read_lock_bh(&loadinfo_lock);
+#ifndef REXEC_LOADTABLE_FAST
 	load = altload(loadinfo[0].load, loadinfo[0].speed, loadinfo[0].ncpus);
+#endif
 	for(l = &loadinfo[1]; l < &loadinfo[INFO_WIN] ; l++)
 #ifdef CONFIG_SSI
+#ifdef REXEC_LOADTABLE_FAST
+	if (l->node && l->mem && l->altload <= loadinfo[0].altload)
+#else
 	if(l->node && l->mem && altload(l->load, l->speed, l->ncpus) <= load)
+#endif
 #else
 	if(l->pe && l->mem > 0 && altload(l->load, l->speed, l->ncpus) <= load)
 #endif
@@ -975,8 +988,12 @@
 	if(loadinfo[i].node && loadinfo[i].speed && loadinfo[i].node != depmach
 		&& (i == 0 || (loadinfo[i].mem >= migpages)))
 	{
+#ifdef REXEC_LOADTABLE_FAST
+		aload[n] = loadinfo[i].altload;
+#else
 		aload[n] = altload(loadinfo[i].load, loadinfo[i].speed,
 				loadinfo[i].ncpus);
+#endif
 		if(i)
 			mach[n] = loadinfo[i].node;
 		else


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev