patch-1.3.47 linux/ipc/shm.c

Next file: linux/kernel/ksyms.c
Previous file: linux/include/net/ip_alias.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.46/linux/ipc/shm.c linux/ipc/shm.c
@@ -445,7 +445,7 @@
 			return -ENOMEM;
 		set_pte(page_table, __pte(shm_sgn));
 	}
-	invalidate();
+	invalidate_range(shmd->vm_mm, shmd->vm_start, shmd->vm_end);
 	return 0;
 }
 
@@ -680,7 +680,7 @@
 	struct vm_area_struct *shmd;
 	unsigned long swap_nr;
 	unsigned long id, idx;
-	int loop = 0, invalid = 0;
+	int loop = 0;
 	int counter;
 	
 	counter = shm_rss >> prio;
@@ -716,8 +716,6 @@
 
 	if (--counter < 0) { /* failed */
 		failed:
-		if (invalid)
-			invalidate();
 		swap_free (swap_nr);
 		return 0;
 	}
@@ -766,7 +764,7 @@
 		mem_map[MAP_NR(pte_page(pte))].count--;
 		if (shmd->vm_mm->rss > 0)
 			shmd->vm_mm->rss--;
-		invalid++;
+		invalidate_range(shmd->vm_mm, shmd->vm_start, shmd->vm_end);
 	    /* continue looping through circular list */
 	    } while (0);
 	    if ((shmd = shmd->vm_next_share) == shp->attaches)
@@ -776,8 +774,6 @@
 	if (mem_map[MAP_NR(pte_page(page))].count != 1)
 		goto check_table;
 	shp->shm_pages[idx] = swap_nr;
-	if (invalid)
-		invalidate();
 	write_swap_page (swap_nr, (char *) pte_page(page));
 	free_page(pte_page(page));
 	swap_successes++;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this