From: Alexander Duyck <alexander.duyck@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Alex Shi <alex.shi@linux.alibaba.com>,
Yang Shi <yang.shi@linux.alibaba.com>,
kbuild test robot <lkp@intel.com>,
Rong Chen <rong.a.chen@intel.com>,
Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Hugh Dickins <hughd@google.com>,
LKML <linux-kernel@vger.kernel.org>,
Daniel Jordan <daniel.m.jordan@oracle.com>,
linux-mm <linux-mm@kvack.org>,
Shakeel Butt <shakeelb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
cgroups@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Wei Yang <richard.weiyang@gmail.com>,
Mel Gorman <mgorman@techsingularity.net>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [RFC PATCH v2 1/5] mm: Identify compound pages sooner in isolate_migratepages_block
Date: Wed, 19 Aug 2020 07:48:11 -0700 [thread overview]
Message-ID: <CAKgT0UfVdaMfg=TiiqOK1axUdmViEeaU+R8sisf5WpOKqa-65w@mail.gmail.com> (raw)
In-Reply-To: <20200819114309.GB17456@casper.infradead.org>
On Wed, Aug 19, 2020 at 4:43 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Aug 18, 2020 at 09:27:05PM -0700, Alexander Duyck wrote:
> > + /*
> > + * Page is compound. We know the order before we know if it is
> > + * on the LRU so we cannot assume it is THP. However since the
> > + * page will have the LRU validated shortly we can use the value
> > + * to skip over this page for now or validate the LRU is set and
> > + * then isolate the entire compound page if we are isolating to
> > + * generate a CMA page.
> > + */
> > + if (PageCompound(page)) {
> > + const unsigned int order = compound_order(page);
> > +
> > + if (likely(order < MAX_ORDER))
> > + low_pfn += (1UL << order) - 1;
>
> Hmm. You're checking for PageCompound but then skipping 1UL << order.
> That only works if PageHead. If instead this is PageCompound because
> it's PageTail, you need to do something like:
>
> low_pfn |= (1UL << order) - 1;
>
> which will move you to the end of the page you're in the middle of.
Can you successfully call get_page_unless_zero in a tail page? I
thought their reference count was 0? There is a get_page_unless_zero
call before the PageCompound check, so I don't think we can get a tail
page.
> If PageTail can't actually happen here, then it's better to check for
> PageHead explicitly and WARN_ON if you get a PageTail (eg a page was
> combined into a compound page after you processed the earlier head page).
>
> Is it possible the page you've found is hugetlbfs? Those can have orders
> larger than MAX_ORDER.
So in theory we only need to jump pageblock_order. However there are
some architectures where that is not a fixed constant and so it would
have some additional overhead if I am not mistaken. In addition we
should have been only provided a pageblock if i am not mistaken so the
check further down that prevents low_pfn from passing end_pfn should
reset to the correct value.
next prev parent reply other threads:[~2020-08-19 14:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 4:26 [RFC PATCH v2 0/5] Minor cleanups and performance optimizations for LRU rework Alexander Duyck
2020-08-19 4:27 ` [RFC PATCH v2 1/5] mm: Identify compound pages sooner in isolate_migratepages_block Alexander Duyck
2020-08-19 7:48 ` Alex Shi
2020-08-19 11:43 ` Matthew Wilcox
2020-08-19 14:48 ` Alexander Duyck [this message]
2020-08-19 4:27 ` [RFC PATCH v2 2/5] mm: Drop use of test_and_set_skip in favor of just setting skip Alexander Duyck
2020-08-19 7:50 ` Alex Shi
2020-08-19 4:27 ` [RFC PATCH v2 3/5] mm: Add explicit page decrement in exception path for isolate_lru_pages Alexander Duyck
2020-08-19 7:50 ` Alex Shi
2020-08-19 14:52 ` Alexander Duyck
2020-08-19 4:27 ` [RFC PATCH v2 4/5] mm: Split release_pages work into 3 passes Alexander Duyck
2020-08-19 7:53 ` Alex Shi
2020-08-19 14:57 ` Alexander Duyck
2020-08-20 9:49 ` Alex Shi
2020-08-20 14:13 ` Alexander Duyck
2020-08-19 4:27 ` [RFC PATCH v2 5/5] mm: Split move_pages_to_lru into 3 separate passes Alexander Duyck
2020-08-19 7:56 ` Alex Shi
2020-08-19 14:42 ` Alexander Duyck
2020-08-20 9:56 ` Alex Shi
2020-08-20 17:15 ` Alexander Duyck
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='CAKgT0UfVdaMfg=TiiqOK1axUdmViEeaU+R8sisf5WpOKqa-65w@mail.gmail.com' \
--to=alexander.duyck@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@linux.alibaba.com \
--cc=cgroups@vger.kernel.org \
--cc=daniel.m.jordan@oracle.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=khlebnikov@yandex-team.ru \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=mgorman@techsingularity.net \
--cc=richard.weiyang@gmail.com \
--cc=rong.a.chen@intel.com \
--cc=shakeelb@google.com \
--cc=tj@kernel.org \
--cc=willy@infradead.org \
--cc=yang.shi@linux.alibaba.com \
/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