From: Hugh Dickins <hughd@google.com>
To: Alex Shi <alex.shi@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.com>,
Mike Kravetz <mike.kravetz@oracle.com>,
Shakeel Butt <shakeelb@google.com>,
Matthew Wilcox <willy@infradead.org>, Qian Cai <cai@lca.pw>,
Chris Wilson <chris@chris-wilson.co.uk>,
Kuo-Hsin Yang <vovoy@chromium.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/5] mm: fix check_move_unevictable_pages() on THP
Date: Mon, 31 Aug 2020 20:59:24 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.11.2008312040530.1019@eggly.anvils> (raw)
In-Reply-To: <5875bdbe-c1af-737b-9ec2-4b48b3c2465f@linux.alibaba.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1812 bytes --]
On Tue, 1 Sep 2020, Alex Shi wrote:
> 在 2020/8/31 上午5:08, Hugh Dickins 写道:
> > --- 5.9-rc2/mm/vmscan.c 2020-08-16 17:32:50.721507348 -0700
> > +++ linux/mm/vmscan.c 2020-08-28 17:47:10.595580876 -0700
> > @@ -4260,8 +4260,14 @@ void check_move_unevictable_pages(struct
> > for (i = 0; i < pvec->nr; i++) {
> > struct page *page = pvec->pages[i];
> > struct pglist_data *pagepgdat = page_pgdat(page);
> > + int nr_pages;
> > +
> > + if (PageTransTail(page))
> > + continue;
> > +
> > + nr_pages = thp_nr_pages(page);
> > + pgscanned += nr_pages;
> >
> > - pgscanned++;
> > if (pagepgdat != pgdat) {
> > if (pgdat)
> > spin_unlock_irq(&pgdat->lru_lock);
> > @@ -4280,7 +4286,7 @@ void check_move_unevictable_pages(struct
> > ClearPageUnevictable(page);
> > del_page_from_lru_list(page, lruvec, LRU_UNEVICTABLE);
> > add_page_to_lru_list(page, lruvec, lru);
>
> So, we might randomly del or add a thp tail page into lru?
> It's interesting to know here. :)
No, it wasn't that interesting, I'd have been more concerned if it was
like that. Amusing idea though: because the act of adding a thp tail
to lru would clear the very bit that says it's a tail.
if (!PageLRU(page) || !PageUnevictable(page))
continue;
Let's see: PageLRU and PageUnevictable are both of the PF_HEAD type,
so permitted on tails, but always redirecting to head: so typically
PageLRU(page) would be true, because head on lru; but PageUnevictable(page)
would be false on tail, because head has already been moved to an evictable
lru by this same function. So it safely went the "continue" way, but
without incrementing pgrescued.
Hugh
>
> Thanks
> Alex
>
> > - pgrescued++;
> > + pgrescued += nr_pages;
> > }
> > }
> >
next prev parent reply other threads:[~2020-09-01 3:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-30 20:57 [PATCH 0/5] mm: fixes to past from future testing Hugh Dickins
2020-08-30 20:59 ` [PATCH 1/5] ksm: reinstate memcg charge on copied pages Hugh Dickins
2020-08-31 14:40 ` Shakeel Butt
2020-09-01 15:01 ` Johannes Weiner
2020-08-30 21:01 ` [PATCH 2/5] mm: migration of hugetlbfs page skip memcg Hugh Dickins
2020-08-31 14:40 ` Shakeel Butt
2020-09-01 15:02 ` Johannes Weiner
2020-08-30 21:08 ` [PATCH 4/5] mm: fix check_move_unevictable_pages() on THP Hugh Dickins
2020-08-31 14:44 ` Shakeel Butt
2020-09-01 2:04 ` Alex Shi
2020-09-01 3:59 ` Hugh Dickins [this message]
2020-09-01 15:57 ` Yang Shi
2020-08-30 21:09 ` [PATCH 5/5] mlock: fix unevictable_pgs event counts " Hugh Dickins
2020-08-31 14:45 ` Shakeel Butt
2020-09-01 15:41 ` Yang Shi
2020-09-01 2:28 ` [PATCH 0/5] mm: fixes to past from future testing Alex Shi
2020-09-01 4:08 ` Hugh Dickins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.2.11.2008312040530.1019@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@linux.alibaba.com \
--cc=cai@lca.pw \
--cc=chris@chris-wilson.co.uk \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=shakeelb@google.com \
--cc=vovoy@chromium.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox