<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 18, 2018 at 5:19 PM, Michal Hocko <span dir="ltr"><<a href="mailto:mhocko@suse.com" target="_blank">mhocko@suse.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Wed 18-04-18 11:07:22, Michal Hocko wrote:<br>
> On Tue 17-04-18 16:09:33, Zi Yan wrote:<br>
</span><span class="gmail-">[...]<br>
> > diff --git a/mm/migrate.c b/mm/migrate.c<br>
</span><span class="gmail-">> > 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, nodemask_t task_nodes,<br>
> >                         if (err)<br>
> >                                 goto out;<br>
> >                 }<br>
> > +               /* Move to next page (i+1), after we have saved page 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>
</span>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></blockquote><div><br><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">​Hi Michal, Zi<br><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">I tried your patch separately<span style="color:rgb(51,51,51);font-family:arial;font-size:18px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline;float:none"></span>, both of them works fine to me.<br></div></div></div><br clear="all"><br>-- <br><div class="gmail_signature">Li Wang<br><a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a></div>
</div></div>