diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:47:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:43 -0500 |
commit | 21ae5b01750f14140809508a478a4413792e0261 (patch) | |
tree | 49fff503cf2e17e0f8e583e83e43b337f9728c23 /mm | |
parent | b15d00b6af617251cc70a908df983e9aff57e169 (diff) |
thp: skip transhuge pages in ksm for now
Skip transhuge pages in ksm for now.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/ksm.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -430,7 +430,7 @@ static struct page *get_mergeable_page(struct rmap_item *rmap_item) | |||
430 | page = follow_page(vma, addr, FOLL_GET); | 430 | page = follow_page(vma, addr, FOLL_GET); |
431 | if (IS_ERR_OR_NULL(page)) | 431 | if (IS_ERR_OR_NULL(page)) |
432 | goto out; | 432 | goto out; |
433 | if (PageAnon(page)) { | 433 | if (PageAnon(page) && !PageTransCompound(page)) { |
434 | flush_anon_page(vma, page, addr); | 434 | flush_anon_page(vma, page, addr); |
435 | flush_dcache_page(page); | 435 | flush_dcache_page(page); |
436 | } else { | 436 | } else { |
@@ -1279,7 +1279,19 @@ next_mm: | |||
1279 | if (ksm_test_exit(mm)) | 1279 | if (ksm_test_exit(mm)) |
1280 | break; | 1280 | break; |
1281 | *page = follow_page(vma, ksm_scan.address, FOLL_GET); | 1281 | *page = follow_page(vma, ksm_scan.address, FOLL_GET); |
1282 | if (!IS_ERR_OR_NULL(*page) && PageAnon(*page)) { | 1282 | if (IS_ERR_OR_NULL(*page)) { |
1283 | ksm_scan.address += PAGE_SIZE; | ||
1284 | cond_resched(); | ||
1285 | continue; | ||
1286 | } | ||
1287 | if (PageTransCompound(*page)) { | ||
1288 | put_page(*page); | ||
1289 | ksm_scan.address &= HPAGE_PMD_MASK; | ||
1290 | ksm_scan.address += HPAGE_PMD_SIZE; | ||
1291 | cond_resched(); | ||
1292 | continue; | ||
1293 | } | ||
1294 | if (PageAnon(*page)) { | ||
1283 | flush_anon_page(vma, *page, ksm_scan.address); | 1295 | flush_anon_page(vma, *page, ksm_scan.address); |
1284 | flush_dcache_page(*page); | 1296 | flush_dcache_page(*page); |
1285 | rmap_item = get_next_rmap_item(slot, | 1297 | rmap_item = get_next_rmap_item(slot, |
@@ -1293,8 +1305,7 @@ next_mm: | |||
1293 | up_read(&mm->mmap_sem); | 1305 | up_read(&mm->mmap_sem); |
1294 | return rmap_item; | 1306 | return rmap_item; |
1295 | } | 1307 | } |
1296 | if (!IS_ERR_OR_NULL(*page)) | 1308 | put_page(*page); |
1297 | put_page(*page); | ||
1298 | ksm_scan.address += PAGE_SIZE; | 1309 | ksm_scan.address += PAGE_SIZE; |
1299 | cond_resched(); | 1310 | cond_resched(); |
1300 | } | 1311 | } |