[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190322163440.GB31194@localhost.localdomain>
Date: Fri, 22 Mar 2019 10:34:41 -0600
From: Keith Busch <kbusch@...nel.org>
To: Yang Shi <shy828301@...il.com>
Cc: Keith Busch <keith.busch@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>, linux-nvdimm@...ts.01.org,
Dave Hansen <dave.hansen@...el.com>,
Dan Williams <dan.j.williams@...el.com>
Subject: Re: [PATCH 3/5] mm: Attempt to migrate page in lieu of discard
On Thu, Mar 21, 2019 at 04:58:16PM -0700, Yang Shi wrote:
> On Thu, Mar 21, 2019 at 1:03 PM Keith Busch <keith.busch@...el.com> wrote:
> > + if (!PageCompound(page)) {
> > + if (migrate_demote_mapping(page)) {
> > + unlock_page(page);
> > + if (likely(put_page_testzero(page)))
> > + goto free_it;
> > +
> > + /*
> > + * Speculative reference will free this page,
> > + * so leave it off the LRU.
> > + */
> > + nr_reclaimed++;
> > + continue;
> > + }
> > + }
>
> It looks the reclaim path would fall through if the migration is
> failed. But, it looks, with patch #4, you may end up trying reclaim an
> anon page on swapless system if migration is failed?
Right, and add_to_swap() will fail and the page jumps to activate_locked
label, placing it back where it was before.
> And, actually I have the same question with Yan Zi. Why not just put
> the demote candidate into a separate list, then migrate all the
> candidates in bulk with migrate_pages()?
The page is already locked at the point we know we want to migrate it.
Powered by blists - more mailing lists