Skip to contentSkip to conversation

mm: fix rss counter being incremented when unmapping

PATCH In review Björn Steinbrink 3 participants 3 messages May 9, 2005 – May 10, 2005

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

PATCH 1/1 mm: fix rss counter being incremented when unmapping

This patch fixes a bug introduced by the "mm counter operations through macros" patch, which replaced a decrement operation in with an increment macro in try_to_unmap_one().

mm/rmap.c 2005-05-09 13:38:03.000000000 +0200 renamed from mm/rmap.c 2005-05-08 17:53:49.000000000 +0200 +1 -1
diff -NurpP --minimal linux-2.6.12-rc4/mm/rmap.c linux-2.6.12-rc4-fixed/mm/rmap.c
@@ -586,7 +586,7 @@ static int try_to_unmap_one(struct page 
                dec_mm_counter(mm, anon_rss);
        }
 
-       inc_mm_counter(mm, rss);
+       dec_mm_counter(mm, rss);
        page_remove_rmap(page);
        page_cache_release(page);
 

--
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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 3 lines · Bjorn Steinbrink

This patch fixes a bug introduced by the "mm counter operations through macros" patch, which replaced a decrement operation in with an increment macro in try_to_unmap_one().

Oops. Patch looks good to me.
Andrew, if you see this could you pick up the
patch from the head of this thread? ;)

Signature · 3 lines
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
#2 lore raw
In reply to Björn Steinbrink

Correct. Thanks for catching that. My latest rss patch also has that.

Quoted 19 lines · Bjorn Steinbrink

This patch fixes a bug introduced by the "mm counter operations through macros" patch, which replaced a decrement operation in with an increment macro in try_to_unmap_one().

diff -NurpP --minimal linux-2.6.12-rc4/mm/rmap.c linux-2.6.12-rc4-fixed/mm/rmap.c

mm/rmap.c 2005-05-09 13:38:03.000000000 +0200 renamed from mm/rmap.c 2005-05-08 17:53:49.000000000 +0200 +1 -2
@@ -586,7 +586,7 @@ static int try_to_unmap_one(struct page
                dec_mm_counter(mm, anon_rss);
        }
 
-       inc_mm_counter(mm, rss);
+       dec_mm_counter(mm, rss);
        page_remove_rmap(page);
        page_cache_release(page);
 
--
Quoted 5 lines

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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
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-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>