Dave Hansen wrote: > > + if (!PageAnon(page)) { > > + add_mm_counter(mm, MM_FILEPAGES, -HPAGE_PMD_NR); > > + add_mm_counter(mm, MM_ANONPAGES, HPAGE_PMD_NR); > > + } > > This seems like a bit of a hack. Shouldn't we have just been accounting > to MM_FILEPAGES in the first place? No, it's not. It handles MAP_PRIVATE file mappings. The page was read first and accounted to MM_FILEPAGES and then COW'ed by anon page here, so we have to adjust counters. do_wp_page() has similar code. -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>