Commit e0f0d9ef authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] do_no_page() rss accounting fix

From: Jaroslav Kysela <perex@suse.cz>

The do_no_page() function in mm/memory.c does accounting for reserved pages
(++mm->rss), but in zap_pte_range() we don't decrement rss if the page was
reserved.

So don't account for PageReserved pages in the rss.  (Maybe it would be
better to fix zap_pte_range in the opposite direction..)
parent 23d77265
......@@ -1459,6 +1459,7 @@ do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
*/
/* Only go through if we didn't race with anybody else... */
if (pte_none(*page_table)) {
if (!PageReserved(new_page))
++mm->rss;
flush_icache_page(vma, new_page);
entry = mk_pte(new_page, vma->vm_page_prot);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment