diff options
author | Mark Brown <broonie@linaro.org> | 2013-11-05 20:06:43 +0000 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-05 20:06:43 +0000 |
commit | 47cf66ff098ac408194713be6531a7bb57d1b99b (patch) | |
tree | 6711205bc3d5f6200adea4ba2173f2d1d9b0c063 /mm | |
parent | 66cadb7bd46c6691eea6f671380405ab03b423ad (diff) | |
parent | 7c9373fbcd0b29f6ccc28407c11ecd51cfa7a3c2 (diff) |
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Diffstat (limited to 'mm')
-rw-r--r-- | mm/huge_memory.c | 10 | ||||
-rw-r--r-- | mm/page-writeback.c | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index b92d0ce428b..0164b09c1e9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2699,6 +2699,7 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address, mmun_start = haddr; mmun_end = haddr + HPAGE_PMD_SIZE; +again: mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end); spin_lock(&mm->page_table_lock); if (unlikely(!pmd_trans_huge(*pmd))) { @@ -2721,7 +2722,14 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address, split_huge_page(page); put_page(page); - BUG_ON(pmd_trans_huge(*pmd)); + + /* + * We don't always have down_write of mmap_sem here: a racing + * do_huge_pmd_wp_page() might have copied-on-write to another + * huge page before our split_huge_page() got the anon_vma lock. + */ + if (unlikely(pmd_trans_huge(*pmd))) + goto again; } void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 4514ad7415c..aca4364275b 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1104,11 +1104,11 @@ static unsigned long dirty_poll_interval(unsigned long dirty, return 1; } -static long bdi_max_pause(struct backing_dev_info *bdi, - unsigned long bdi_dirty) +static unsigned long bdi_max_pause(struct backing_dev_info *bdi, + unsigned long bdi_dirty) { - long bw = bdi->avg_write_bandwidth; - long t; + unsigned long bw = bdi->avg_write_bandwidth; + unsigned long t; /* * Limit pause time for small memory systems. If sleeping for too long @@ -1120,7 +1120,7 @@ static long bdi_max_pause(struct backing_dev_info *bdi, t = bdi_dirty / (1 + bw / roundup_pow_of_two(1 + HZ / 8)); t++; - return min_t(long, t, MAX_PAUSE); + return min_t(unsigned long, t, MAX_PAUSE); } static long bdi_min_pause(struct backing_dev_info *bdi, |