<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Apr 18, 2018, 19:29 Michal Hocko <<a href="mailto:mhocko@suse.com" target="_blank" rel="noreferrer">mhocko@suse.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed 18-04-18 18:39:19, Li Wang wrote:<br>
> On Wed, Apr 18, 2018 at 5:19 PM, Michal Hocko <<a href="mailto:mhocko@suse.com" rel="noreferrer noreferrer" target="_blank">mhocko@suse.com</a>> wrote:<br>
> <br>
> > On Wed 18-04-18 11:07:22, Michal Hocko wrote:<br>
> > > On Tue 17-04-18 16:09:33, Zi Yan wrote:<br>
> > [...]<br>
> > > > diff --git a/mm/migrate.c b/mm/migrate.c<br>
> > > > index f65dd69e1fd1..32afa4723e7f 100644<br>
> > > > --- a/mm/migrate.c<br>
> > > > +++ b/mm/migrate.c<br>
> > > > @@ -1619,6 +1619,8 @@ static int do_pages_move(struct mm_struct *mm,<br>
> > nodemask_t task_nodes,<br>
> > > >                         if (err)<br>
> > > >                                 goto out;<br>
> > > >                 }<br>
> > > > +               /* Move to next page (i+1), after we have saved page<br>
> > status (until i) */<br>
> > > > +               start = i + 1;<br>
> > > >                 current_node = NUMA_NO_NODE;<br>
> > > >         }<br>
> > > >  out_flush:<br>
> > > ><br>
> > > > Feel free to check it by yourselves.<br>
> > ><br>
> > > Yes, you are right. I never update start if the last page in the range<br>
> > > fails and so we overwrite the whole [start, i] range. I wish the code<br>
> > > wasn't that ugly and subtle but considering how we can fail in different<br>
> > > ways and that we want to batch as much as possible I do not see an easy<br>
> > > way.<br>
> > ><br>
> > > Care to send the patch? I would just drop the comment.<br>
> ><br>
> > Hmm, thinking about it some more. An alternative would be to check for<br>
> > list_empty on the page list. It is a bit larger diff but maybe that<br>
> > would be tiny bit cleaner because there is simply no point to call<br>
> > do_move_pages_to_node on an empty list in the first place.<br>
> ><br>
> <br>
> ​Hi Michal, Zi<br>
> <br>
> I tried your patch separately, both of them works fine to me.<br>
<br>
Thanks for retesting! Do you plan to post a patch with the changelog or<br>
should I do it?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You better.</div><div dir="auto"><br></div><div dir="auto">Li Wang</div></div>