Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230783
b: refs/heads/master
c: 21ae5b0
h: refs/heads/master
i:
  230781: cde8c3d
  230779: c5ed703
  230775: 381dbeb
  230767: 7c049a7
  230751: cec277a
  230719: fdd8e45
  230655: 09898ce
v: v3
  • Loading branch information
Andrea Arcangeli authored and Linus Torvalds committed Jan 14, 2011
1 parent 00640b8 commit 0bb77c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 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: b15d00b6af617251cc70a908df983e9aff57e169
refs/heads/master: 21ae5b01750f14140809508a478a4413792e0261
19 changes: 15 additions & 4 deletions trunk/mm/ksm.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static struct page *get_mergeable_page(struct rmap_item *rmap_item)
page = follow_page(vma, addr, FOLL_GET);
if (IS_ERR_OR_NULL(page))
goto out;
if (PageAnon(page)) {
if (PageAnon(page) && !PageTransCompound(page)) {
flush_anon_page(vma, page, addr);
flush_dcache_page(page);
} else {
Expand Down Expand Up @@ -1279,7 +1279,19 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)
if (ksm_test_exit(mm))
break;
*page = follow_page(vma, ksm_scan.address, FOLL_GET);
if (!IS_ERR_OR_NULL(*page) && PageAnon(*page)) {
if (IS_ERR_OR_NULL(*page)) {
ksm_scan.address += PAGE_SIZE;
cond_resched();
continue;
}
if (PageTransCompound(*page)) {
put_page(*page);
ksm_scan.address &= HPAGE_PMD_MASK;
ksm_scan.address += HPAGE_PMD_SIZE;
cond_resched();
continue;
}
if (PageAnon(*page)) {
flush_anon_page(vma, *page, ksm_scan.address);
flush_dcache_page(*page);
rmap_item = get_next_rmap_item(slot,
Expand All @@ -1293,8 +1305,7 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)
up_read(&mm->mmap_sem);
return rmap_item;
}
if (!IS_ERR_OR_NULL(*page))
put_page(*page);
put_page(*page);
ksm_scan.address += PAGE_SIZE;
cond_resched();
}
Expand Down

0 comments on commit 0bb77c6

Please sign in to comment.