aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2016-01-15 19:52:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-15 20:56:32 -0500
commitd281ee6145183594788ab6d5b55f8d144e69eace (patch)
tree08b535efb69098d6cb9eef938ad63316be2d70b4 /kernel/events
parentafd9883f93b6d030682d7072852b50c5a1b17b63 (diff)
rmap: add argument to charge compound page
We're going to allow mapping of individual 4k pages of THP compound page. It means we cannot rely on PageTransHuge() check to decide if map/unmap small page or THP. The patch adds new argument to rmap functions to indicate whether we want to operate on whole compound page or only the small page. [n-horiguchi@ah.jp.nec.com: fix mapcount mismatch in hugepage migration] Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Tested-by: Sasha Levin <sasha.levin@oracle.com> Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Jerome Marchand <jmarchan@redhat.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Cc: Steve Capper <steve.capper@linaro.org> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Christoph Lameter <cl@linux.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/uprobes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index bb0669169716..060c7a0edfdf 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -175,7 +175,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
175 goto unlock; 175 goto unlock;
176 176
177 get_page(kpage); 177 get_page(kpage);
178 page_add_new_anon_rmap(kpage, vma, addr); 178 page_add_new_anon_rmap(kpage, vma, addr, false);
179 mem_cgroup_commit_charge(kpage, memcg, false); 179 mem_cgroup_commit_charge(kpage, memcg, false);
180 lru_cache_add_active_or_unevictable(kpage, vma); 180 lru_cache_add_active_or_unevictable(kpage, vma);
181 181
@@ -188,7 +188,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
188 ptep_clear_flush_notify(vma, addr, ptep); 188 ptep_clear_flush_notify(vma, addr, ptep);
189 set_pte_at_notify(mm, addr, ptep, mk_pte(kpage, vma->vm_page_prot)); 189 set_pte_at_notify(mm, addr, ptep, mk_pte(kpage, vma->vm_page_prot));
190 190
191 page_remove_rmap(page); 191 page_remove_rmap(page, false);
192 if (!page_mapped(page)) 192 if (!page_mapped(page))
193 try_to_free_swap(page); 193 try_to_free_swap(page);
194 pte_unmap_unlock(ptep, ptl); 194 pte_unmap_unlock(ptep, ptl);