[patch 45/56] Fix /proc/$/om/where

Florian Delizy <[email protected]> Thu, 02 Nov 2006 22:57:16 +0100
Newsgroups gmane.linux.cluster.openmosix.devel
Message-ID <[email protected]>
This patch fixes /proc/$/om/where as pointed by Carl Radford,
the 'where' proc should not return 'home' if the process is currently
migrating...

Added a little test to report migrating, which will be the default
behavior for now

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
openMosix-devel mailing list
openMosix-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/openmosix-devel
fix_proc_pid_get_where.patch (text/x-patch, 1.1 KB)
Subject: [patch @num@/@total@] Fix /proc/$/om/where

This patch fixes /proc/$/om/where as pointed by Carl Radford,
the 'where' proc should not return 'home' if the process is currently
migrating...

Added a little test to report migrating, which will be the default
behavior for now
Index: linux/hpc/proc.c
===================================================================
--- linux.orig/hpc/proc.c	2006-11-02 22:52:38.000000000 +0100
+++ linux/hpc/proc.c	2006-11-02 22:52:49.000000000 +0100
@@ -113,12 +113,13 @@
 	struct sockaddr_in *saddr;
 	unsigned int addr;
 
-	if (task_test_dflags(p, DMIGRATED)) {
-	/* FIXME:  what if process is currently migrating? */
+	if (task_test_dreqs(current, DREQ_MOVE)) {
+		length = sprintf(buf, "migrating\n");
+	} else if (task_test_dflags(p, DMIGRATED)) {
 		saddr=(struct sockaddr_in *)p->om.whereto;
 		addr=saddr->sin_addr.s_addr;
 		length=sprintf(buf, "%u.%u.%u.%u\n", (0x000000FF & addr), (0x0000FF00 & addr)>>8,
-							(0x00FF0000 & addr)>>16, (0xFF000000 & addr) >> 24);
+						     (0x00FF0000 & addr)>>16, (0xFF000000 & addr) >> 24);
 	} else
 		length = sprintf(buf, "home\n");