Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230780
b: refs/heads/master
c: 7913417
h: refs/heads/master
v: v3
  • Loading branch information
Andrea Arcangeli authored and Linus Torvalds committed Jan 14, 2011
1 parent c5ed703 commit 3175152
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9bbfbe30ae088cc88a4b2ba7732baeebd1a0162
refs/heads/master: 79134171df238171daa4c024a42b77b401ccb00b
14 changes: 13 additions & 1 deletion trunk/fs/proc/meminfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
"VmallocChunk: %8lu kB\n"
#ifdef CONFIG_MEMORY_FAILURE
"HardwareCorrupted: %5lu kB\n"
#endif
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
"AnonHugePages: %8lu kB\n"
#endif
,
K(i.totalram),
Expand Down Expand Up @@ -128,7 +131,12 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
K(i.freeswap),
K(global_page_state(NR_FILE_DIRTY)),
K(global_page_state(NR_WRITEBACK)),
K(global_page_state(NR_ANON_PAGES)),
K(global_page_state(NR_ANON_PAGES)
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+ global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
HPAGE_PMD_NR
#endif
),
K(global_page_state(NR_FILE_MAPPED)),
K(global_page_state(NR_SHMEM)),
K(global_page_state(NR_SLAB_RECLAIMABLE) +
Expand All @@ -150,6 +158,10 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
vmi.largest_chunk >> 10
#ifdef CONFIG_MEMORY_FAILURE
,atomic_long_read(&mce_bad_pages) << (PAGE_SHIFT - 10)
#endif
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
HPAGE_PMD_NR)
#endif
);

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ enum zone_stat_item {
NUMA_LOCAL, /* allocation from local node */
NUMA_OTHER, /* allocation from other node */
#endif
NR_ANON_TRANSPARENT_HUGEPAGES,
NR_VM_ZONE_STAT_ITEMS };

/*
Expand Down
3 changes: 3 additions & 0 deletions trunk/mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ static void __split_huge_page_refcount(struct page *page)
lru_add_page_tail(zone, page, page_tail);
}

__dec_zone_page_state(page, NR_ANON_TRANSPARENT_HUGEPAGES);
__mod_zone_page_state(zone, NR_ANON_PAGES, HPAGE_PMD_NR);

ClearPageCompound(page);
compound_unlock(page);
spin_unlock_irq(&zone->lru_lock);
Expand Down
20 changes: 16 additions & 4 deletions trunk/mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,13 @@ void do_page_add_anon_rmap(struct page *page,
struct vm_area_struct *vma, unsigned long address, int exclusive)
{
int first = atomic_inc_and_test(&page->_mapcount);
if (first)
__inc_zone_page_state(page, NR_ANON_PAGES);
if (first) {
if (!PageTransHuge(page))
__inc_zone_page_state(page, NR_ANON_PAGES);
else
__inc_zone_page_state(page,
NR_ANON_TRANSPARENT_HUGEPAGES);
}
if (unlikely(PageKsm(page)))
return;

Expand Down Expand Up @@ -911,7 +916,10 @@ void page_add_new_anon_rmap(struct page *page,
VM_BUG_ON(address < vma->vm_start || address >= vma->vm_end);
SetPageSwapBacked(page);
atomic_set(&page->_mapcount, 0); /* increment count (starts at -1) */
__inc_zone_page_state(page, NR_ANON_PAGES);
if (!PageTransHuge(page))
__inc_zone_page_state(page, NR_ANON_PAGES);
else
__inc_zone_page_state(page, NR_ANON_TRANSPARENT_HUGEPAGES);
__page_set_anon_rmap(page, vma, address, 1);
if (page_evictable(page, vma))
lru_cache_add_lru(page, LRU_ACTIVE_ANON);
Expand Down Expand Up @@ -964,7 +972,11 @@ void page_remove_rmap(struct page *page)
return;
if (PageAnon(page)) {
mem_cgroup_uncharge_page(page);
__dec_zone_page_state(page, NR_ANON_PAGES);
if (!PageTransHuge(page))
__dec_zone_page_state(page, NR_ANON_PAGES);
else
__dec_zone_page_state(page,
NR_ANON_TRANSPARENT_HUGEPAGES);
} else {
__dec_zone_page_state(page, NR_FILE_MAPPED);
mem_cgroup_update_file_mapped(page, -1);
Expand Down
1 change: 1 addition & 0 deletions trunk/mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ static const char * const vmstat_text[] = {
"numa_local",
"numa_other",
#endif
"nr_anon_transparent_hugepages",
"nr_dirty_threshold",
"nr_dirty_background_threshold",

Expand Down

0 comments on commit 3175152

Please sign in to comment.