lkml.org 
[lkml]   [2017]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] mm, memory_hotplug: do not fail offlining too early
On Tue 05-09-17 11:59:36, Anshuman Khandual wrote:
[...]
> > @@ -1634,43 +1634,25 @@ static int __ref __offline_pages(unsigned long start_pfn,
> >
> > pfn = start_pfn;
> > expire = jiffies + timeout;
> > - drain = 0;
> > - retry_max = 5;
> > repeat:
> > /* start memory hot removal */
> > - ret = -EAGAIN;
> > + ret = -EBUSY;
> > if (time_after(jiffies, expire))
> > goto failed_removal;
> > ret = -EINTR;
> > if (signal_pending(current))
> > goto failed_removal;
> > - ret = 0;
> > - if (drain) {
> > - lru_add_drain_all_cpuslocked();
> > - cond_resched();
> > - drain_all_pages(zone);
> > - }
>
> Why we had this condition before that only when we fail in migration
> later in do_migrate_range function, drain the lru lists in the next
> attempt. Why not from the first attempt itself ? Just being curious.

I can only guess but draining used to invoke IPIs and that is really
costly so an optimistic attempt could try without draining and do that
only if the migration fails. Now that we have it all done in WQ context
there shouldn't be any reason to optimize for draining.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2017-09-05 09:17    [W:0.267 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site