diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2012-03-28 17:42:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 20:14:35 -0400 |
commit | 45f83cefe3a5f0476ac3f96382ebfdc3fe4caab2 (patch) | |
tree | b2f7d3c02923d89db5a551c6a7923121db9610c4 /mm | |
parent | 623e3db9f9b7d6e7b2a99180f9cf0825c936ab7a (diff) |
mm: thp: fix up pmd_trans_unstable() locations
pmd_trans_unstable() should be called before pmd_offset_map() in the
locations where the mmap_sem is held for reading.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mark Salter <msalter@redhat.com>
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/memcontrol.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b2ee6df0e9bb..7d698df4a067 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -5306,6 +5306,8 @@ static int mem_cgroup_count_precharge_pte_range(pmd_t *pmd, | |||
5306 | return 0; | 5306 | return 0; |
5307 | } | 5307 | } |
5308 | 5308 | ||
5309 | if (pmd_trans_unstable(pmd)) | ||
5310 | return 0; | ||
5309 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); | 5311 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); |
5310 | for (; addr != end; pte++, addr += PAGE_SIZE) | 5312 | for (; addr != end; pte++, addr += PAGE_SIZE) |
5311 | if (get_mctgt_type(vma, addr, *pte, NULL)) | 5313 | if (get_mctgt_type(vma, addr, *pte, NULL)) |
@@ -5502,6 +5504,8 @@ static int mem_cgroup_move_charge_pte_range(pmd_t *pmd, | |||
5502 | return 0; | 5504 | return 0; |
5503 | } | 5505 | } |
5504 | 5506 | ||
5507 | if (pmd_trans_unstable(pmd)) | ||
5508 | return 0; | ||
5505 | retry: | 5509 | retry: |
5506 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); | 5510 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); |
5507 | for (; addr != end; addr += PAGE_SIZE) { | 5511 | for (; addr != end; addr += PAGE_SIZE) { |