On 11/5/19 7:28 AM, Wei Yang wrote: > On Mon, Nov 04, 2019 at 07:32:51PM -0800, Matthew Wilcox wrote: >> On Tue, Nov 05, 2019 at 10:26:44AM +0800, Wei Yang wrote: >>> Hi, All, >>> >>> I am curious about the semantic of __count_vm_event[s]. >>> >>> For example, we count PGDEACTIVATE event in lru_deactivate_file_fn() and >>> lru_deactivate_fn(). One of them count with number of page, the other not. >>> >>> Just curious about the exact value we want to count. >> >> I don't understand the question. We deactivate one page >> in lru_deactivate_file_fn(). We deactivate several pages in >> shrink_active_list(). PGDEACTIVATE counts the number of pages which >> have been deactivated. >> >> Does that answer your question? > > Not yet. > > In function, lru_deactivate_fn(), __count_vm_events's second parameter is > hpage_nr_pages(page). This is the number in size of "normal" page. Per my > understanding, the page deactivated in lru_deactivate_file_fn() could be a > hpage too. But it just count the deactivation once instead of > hpage_nr_pages(). > > Or you want to say the page deactivated in lru_deactivate_file_fn() must be an > order 0 page? I suspect that was true before THP on shmem, but now perhaps it's not true anymore? CCing Kirill and Hugh.