[patch 21/21] Packet deletion fix

Florian Delizy <[email protected]> Wed, 01 Nov 2006 05:12:47 +0100
Newsgroups gmane.linux.cluster.openmosix.devel
Message-ID <[email protected]>
This patch fix the packet deletion, (which caused some memory leaks )

-------------------------------------------------------------------------
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-packet-deletion.patch (text/x-patch, 3.2 KB)
Subject: [patch @num@/@total@] Packet deletion fix

This patch fix the packet deletion, (which caused some memory leaks )

Index: linux-2.6.17/hpc/copyuser.c
===================================================================
--- linux-2.6.17.orig/hpc/copyuser.c	2006-11-01 04:56:52.000000000 +0100
+++ linux-2.6.17/hpc/copyuser.c	2006-11-01 04:57:08.000000000 +0100
@@ -425,17 +425,13 @@
 					kcom_add_packet( task, send_pkt );
 
 					ret=pkt->addr;  /* the return value is stored in the addr field */
-					list_del(&pkt->list);
-					kmem_cache_free(kcom_pkt_cachep, pkt);
-					set_current_state(TASK_RUNNING);
+					kcom_pkt_delete( pkt );
 					schedule();
 					return ret;
 					break;
 
 			}
-
-			list_del(&pkt->list);
-			kmem_cache_free(kcom_pkt_cachep, pkt);
+			kcom_pkt_delete( pkt );
 		}
 
 		if (list_empty(&task->in_packs)) {
Index: linux-2.6.17/hpc/deputy.c
===================================================================
--- linux-2.6.17.orig/hpc/deputy.c	2006-11-01 04:56:52.000000000 +0100
+++ linux-2.6.17/hpc/deputy.c	2006-11-01 04:57:44.000000000 +0100
@@ -515,7 +515,7 @@
 
 
 					error = deputy_do_syscall(p, pkt);
-					list_del(&pkt->list);
+ 					kcom_pkt_delete( pkt );
 				}
 			}
 
Index: linux-2.6.17/hpc/kcomd.c
===================================================================
--- linux-2.6.17.orig/hpc/kcomd.c	2006-11-01 04:56:52.000000000 +0100
+++ linux-2.6.17/hpc/kcomd.c	2006-11-01 04:57:08.000000000 +0100
@@ -738,8 +738,7 @@
 			list_for_each_entry_safe(pkt, pkt_next, &task->in_packs, list) {
 				if ((pkt->len) > 0)
 					kfree(pkt->data);
-				kmem_cache_free(kcom_pkt_cachep, pkt);
-				list_del(&pkt->list);
+				kcom_pkt_delete( pkt );
 			}
 			write_unlock( &task->in_packs_lock );
 
@@ -747,8 +746,7 @@
 			list_for_each_entry_safe(pkt, pkt_next, &task->out_packs, list) {
 				if ((pkt->len) > 0)
 					kfree(pkt->data);
-				kmem_cache_free(kcom_pkt_cachep, pkt);
-				list_del(&pkt->list);
+				kcom_pkt_delete( pkt );
 			}
 			write_unlock( &task->out_packs_lock );
 
Index: linux-2.6.17/hpc/kernel.c
===================================================================
--- linux-2.6.17.orig/hpc/kernel.c	2006-11-01 04:56:51.000000000 +0100
+++ linux-2.6.17/hpc/kernel.c	2006-11-01 04:57:08.000000000 +0100
@@ -171,8 +171,7 @@
 			list_for_each_entry_safe(pkt, pkt_next, &mytsk->in_packs, list) {
 				if ((pkt->type & MIG_MASK) == MIG_SYSCALL) {
 					if ((pkt->type & SYSCALL_MASK) == DEP_SIGNAL) {
-						remote_do_signal(p, pkt);
-						list_del(&pkt->list);
+						kcom_pkt_delete( pkt );
 					}
 				}
 			}
Index: linux-2.6.17/hpc/migrecv.c
===================================================================
--- linux-2.6.17.orig/hpc/migrecv.c	2006-11-01 04:56:52.000000000 +0100
+++ linux-2.6.17/hpc/migrecv.c	2006-11-01 04:57:08.000000000 +0100
@@ -553,9 +553,7 @@
 					task_clear_dflags(p, DINCOMING);
 					flush_tlb_mm(p->mm); /* for all the new pages */
 
-					list_del(&pkt->list);
-					kmem_cache_free(kcom_pkt_cachep, pkt);
-
+					kcom_pkt_delete( pkt );
 					write_unlock( &mytsk->in_packs_lock );
 					if (!ret) set_current_state(TASK_RUNNING);
 
@@ -570,8 +568,7 @@
 					break;
 
 			}
-			list_del(&pkt->list);
-			kmem_cache_free(kcom_pkt_cachep, pkt);
+			kcom_pkt_delete( pkt );
 			if (ret)
 				goto protocol_exit;