lkml.org 
[lkml]   [2013]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCHv3, RFC 32/34] thp: handle write-protect exception to file-backed huge pages
Date
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


\
 
 \ /
  Last update: 2013-04-26 18:01    [W:1.433 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site