Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286607
b: refs/heads/master
c: 9f9f1ac
h: refs/heads/master
i:
  286605: bb20f40
  286603: e7a8d63
  286599: 9f2a58f
  286591: 76420a9
v: v3
  • Loading branch information
Konstantin Khlebnikov authored and Linus Torvalds committed Jan 23, 2012
1 parent b9f0b7d commit 1ba467f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 245132643e1cfcd145bbc86a716c1818371fcb93
refs/heads/master: 9f9f1acd713d69fae2af286fbeedc6c8963411c6
37 changes: 28 additions & 9 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,15 +878,24 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
}
if (likely(!non_swap_entry(entry)))
rss[MM_SWAPENTS]++;
else if (is_write_migration_entry(entry) &&
is_cow_mapping(vm_flags)) {
/*
* COW mappings require pages in both parent
* and child to be set to read.
*/
make_migration_entry_read(&entry);
pte = swp_entry_to_pte(entry);
set_pte_at(src_mm, addr, src_pte, pte);
else if (is_migration_entry(entry)) {
page = migration_entry_to_page(entry);

if (PageAnon(page))
rss[MM_ANONPAGES]++;
else
rss[MM_FILEPAGES]++;

if (is_write_migration_entry(entry) &&
is_cow_mapping(vm_flags)) {
/*
* COW mappings require pages in both
* parent and child to be set to read.
*/
make_migration_entry_read(&entry);
pte = swp_entry_to_pte(entry);
set_pte_at(src_mm, addr, src_pte, pte);
}
}
}
goto out_set_pte;
Expand Down Expand Up @@ -1191,6 +1200,16 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,

if (!non_swap_entry(entry))
rss[MM_SWAPENTS]--;
else if (is_migration_entry(entry)) {
struct page *page;

page = migration_entry_to_page(entry);

if (PageAnon(page))
rss[MM_ANONPAGES]--;
else
rss[MM_FILEPAGES]--;
}
if (unlikely(!free_swap_and_cache(entry)))
print_bad_pte(vma, addr, ptent, NULL);
}
Expand Down

0 comments on commit 1ba467f

Please sign in to comment.