Skip to contentSkip to conversation

PATCH:

PATCH Juan J. Quintela 1 participant 1 message Jul 12, 2000

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi

        somebody pointed out that mm->rss is defined as an unsigned
        long, I think this patch is needed to do the desired effect.
        I have not founded other invalid uses of mm->rss.  Only that
        in someplaces it is tested against (mm->rss <= 0) instead of
        (mm->rss == 0).  I think that the last checks are harmless.

Later, Juan.

mm/memory.c +4 -4
diff -urN --exclude-from=/home/lfcia/quintela/work/kernel/exclude base/mm/memory.c working/mm/memory.c
@@ -373,12 +373,12 @@
 	spin_unlock(&mm->page_table_lock);
 	/*
 	 * Update rss for the mm_struct (not necessarily current->mm)
+	 * Notice that rss is an unsigned long.
 	 */
-	if (mm->rss > 0) {
+	if (mm->rss > freed)
 		mm->rss -= freed;
-		if (mm->rss < 0)
-			mm->rss = 0;
-	}
+	else
+		mm->rss = 0;
 }
 
 
Signature · 6 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/