lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@intel.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.

\
 
 \ /
  Last update: 2019-03-22 17:34    [W:0.057 / U:3.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site