[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170905071307.7aggprk66r3cem4p@dhcp22.suse.cz>
Date: Tue, 5 Sep 2017 09:13:07 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Reza Arbab <arbab@...ux.vnet.ibm.com>,
Yasuaki Ishimatsu <yasu.isimatu@...il.com>,
qiuxishi@...wei.com, Igor Mammedov <imammedo@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>, linux-mm@...ck.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [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
Powered by blists - more mailing lists