Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-20 Thread Yang Shi
[ check_move_unevictable_pages() seems weird. It gets a pagevec from find_get_entries(), which, if I understand the THP page cache code correctly, might contain the same compound page over and over. It'll be !unevictable after the first iteration, so will only run once. So it produc

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-20 Thread Yang Shi
On 5/20/19 5:43 PM, Yang Shi wrote: On 5/16/19 11:10 PM, Johannes Weiner wrote: On Tue, May 14, 2019 at 01:44:35PM -0700, Yang Shi wrote: On 5/13/19 11:20 PM, Michal Hocko wrote: On Mon 13-05-19 21:36:59, Yang Shi wrote: On Mon, May 13, 2019 at 2:45 PM Michal Hocko wrote: On Mon 13-05-

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-20 Thread Yang Shi
On 5/16/19 11:10 PM, Johannes Weiner wrote: On Tue, May 14, 2019 at 01:44:35PM -0700, Yang Shi wrote: On 5/13/19 11:20 PM, Michal Hocko wrote: On Mon 13-05-19 21:36:59, Yang Shi wrote: On Mon, May 13, 2019 at 2:45 PM Michal Hocko wrote: On Mon 13-05-19 14:09:59, Yang Shi wrote: [...] I t

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-16 Thread Johannes Weiner
On Tue, May 14, 2019 at 01:44:35PM -0700, Yang Shi wrote: > On 5/13/19 11:20 PM, Michal Hocko wrote: > > On Mon 13-05-19 21:36:59, Yang Shi wrote: > > > On Mon, May 13, 2019 at 2:45 PM Michal Hocko wrote: > > > > On Mon 13-05-19 14:09:59, Yang Shi wrote: > > > > [...] > > > > > I think we can just

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-14 Thread Yang Shi
On 5/13/19 11:20 PM, Michal Hocko wrote: On Mon 13-05-19 21:36:59, Yang Shi wrote: On Mon, May 13, 2019 at 2:45 PM Michal Hocko wrote: On Mon 13-05-19 14:09:59, Yang Shi wrote: [...] I think we can just account 512 base pages for nr_scanned for isolate_lru_pages() to make the counters sane

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-13 Thread Michal Hocko
On Mon 13-05-19 21:36:59, Yang Shi wrote: > On Mon, May 13, 2019 at 2:45 PM Michal Hocko wrote: > > > > On Mon 13-05-19 14:09:59, Yang Shi wrote: > > [...] > > > I think we can just account 512 base pages for nr_scanned for > > > isolate_lru_pages() to make the counters sane since PGSCAN_KSWAPD/DI

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-13 Thread Yang Shi
On Mon, May 13, 2019 at 2:45 PM Michal Hocko wrote: > > On Mon 13-05-19 14:09:59, Yang Shi wrote: > [...] > > I think we can just account 512 base pages for nr_scanned for > > isolate_lru_pages() to make the counters sane since PGSCAN_KSWAPD/DIRECT > > just use it. > > > > And, sc->nr_scanned shou

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-13 Thread Michal Hocko
On Mon 13-05-19 14:09:59, Yang Shi wrote: [...] > I think we can just account 512 base pages for nr_scanned for > isolate_lru_pages() to make the counters sane since PGSCAN_KSWAPD/DIRECT > just use it. > > And, sc->nr_scanned should be accounted as 512 base pages too otherwise we > may have nr_sca

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-13 Thread Yang Shi
On 5/13/19 1:09 AM, Michal Hocko wrote: On Sat 11-05-19 00:23:40, Yang Shi wrote: Since commit bd4c82c22c36 ("mm, THP, swap: delay splitting THP after swapped out"), THP can be swapped out in a whole. But, nr_reclaimed still gets inc'ed by one even though a whole THP (512 pages) gets swapped

Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-13 Thread Michal Hocko
On Sat 11-05-19 00:23:40, Yang Shi wrote: > Since commit bd4c82c22c36 ("mm, THP, swap: delay splitting THP after > swapped out"), THP can be swapped out in a whole. But, nr_reclaimed > still gets inc'ed by one even though a whole THP (512 pages) gets > swapped out. > > This doesn't make too much

[v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-10 Thread Yang Shi
Since commit bd4c82c22c36 ("mm, THP, swap: delay splitting THP after swapped out"), THP can be swapped out in a whole. But, nr_reclaimed still gets inc'ed by one even though a whole THP (512 pages) gets swapped out. This doesn't make too much sense to memory reclaim. For example, direct reclaim