linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: Qian Cai <cai@lca.pw>
Cc: fabecassis@nvidia.com, jhubbard@nvidia.com, mhocko@suse.com,
	cl@linux.com, vbabka@suse.cz, mgorman@techsingularity.net,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [v3 PATCH] mm: move_pages: return valid node id in status if the page is already on the target node
Date: Thu, 5 Dec 2019 11:27:27 -0800	[thread overview]
Message-ID: <d96e3849-5fd4-26c0-31cf-02523085ed37@linux.alibaba.com> (raw)
In-Reply-To: <0E1D1C04-5892-438F-9191-F23CBE1A6DC5@lca.pw>



On 12/5/19 11:19 AM, Qian Cai wrote:
>
>> On Dec 5, 2019, at 1:54 PM, Yang Shi <yang.shi@linux.alibaba.com> wrote:
>>
>> This is because the status is not set if the page is already on the
>> target node, but move_pages() should return valid status as long as it
>> succeeds.  The valid status may be errno or node id.
>>
>> We can't simply initialize status array to zero since the pages may be
>> not on node 0.  Fix it by updating status with node id which the page is
>> already on.
> This does not look correct either.
>
> “ENOENT
> No pages were found that require moving. All pages are either already on the target node, not present, had an invalid address or could not be moved because they were mapped by multiple processes.”
>
> move_pages() should return -ENOENT instead.

Yes, we noticed this too. I had a note in v1 and v2 patch, but I forgot 
paste in v3, says:

John noticed another return value inconsistency between the 
implementation and the manpage. The manpage says it should return 
-ENOENT if the page is already on the target node, but it doesn't. It 
looks the original code didn't return -ENOENT either, I'm not sure if 
this is a document issue or not. Anyway this is another issue, once we 
confirm it we can fix it later.

And, Michal also commented to the note:

I do not remember all the details but my recollection is that there were 
several inconsistencies present before I touched the code and I've 
decided to not touch them without a clear usecase.



  reply	other threads:[~2019-12-05 19:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 18:54 Yang Shi
2019-12-05 19:19 ` Qian Cai
2019-12-05 19:27   ` Yang Shi [this message]
2019-12-05 19:34     ` Qian Cai
2019-12-05 22:09       ` Yang Shi
2019-12-05 22:23         ` Qian Cai
2019-12-05 22:41           ` John Hubbard
2019-12-05 23:16             ` Qian Cai
2019-12-05 23:24               ` John Hubbard
2019-12-05 23:58                 ` Qian Cai
2019-12-06  0:04                   ` John Hubbard
2019-12-06  0:19                     ` Qian Cai
2019-12-06  1:11                       ` Yang Shi
2019-12-05 19:45 ` Christopher Lameter
2019-12-05 21:59   ` Yang Shi
2019-12-06  7:35   ` Michal Hocko
2019-12-05 21:27 ` John Hubbard
2019-12-05 22:00   ` Yang Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d96e3849-5fd4-26c0-31cf-02523085ed37@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=cl@linux.com \
    --cc=fabecassis@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=stable@vger.kernel.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox