File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -2748,19 +2748,11 @@ int mem_cgroup_newpage_charge(struct page *page,
2748
2748
{
2749
2749
if (mem_cgroup_disabled ())
2750
2750
return 0 ;
2751
- /*
2752
- * If already mapped, we don't have to account.
2753
- * If page cache, page->mapping has address_space.
2754
- * But page->mapping may have out-of-use anon_vma pointer,
2755
- * detecit it by PageAnon() check. newly-mapped-anon's page->mapping
2756
- * is NULL.
2757
- */
2758
- if (page_mapped (page ) || (page -> mapping && !PageAnon (page )))
2759
- return 0 ;
2760
- if (unlikely (!mm ))
2761
- mm = & init_mm ;
2751
+ VM_BUG_ON (page_mapped (page ));
2752
+ VM_BUG_ON (page -> mapping && !PageAnon (page ));
2753
+ VM_BUG_ON (!mm );
2762
2754
return mem_cgroup_charge_common (page , mm , gfp_mask ,
2763
- MEM_CGROUP_CHARGE_TYPE_MAPPED );
2755
+ MEM_CGROUP_CHARGE_TYPE_MAPPED );
2764
2756
}
2765
2757
2766
2758
static void
You can’t perform that action at this time.
0 commit comments