linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	 Zi Yan <ziy@nvidia.com>, Michal Hocko <mhocko@suse.com>,
	Huang Ying <ying.huang@intel.com>,
	 Hugh Dickins <hughd@google.com>,
	hca@linux.ibm.com, gor@linux.ibm.com,  borntraeger@de.ibm.com,
	Andrew Morton <akpm@linux-foundation.org>,
	 Linux MM <linux-mm@kvack.org>,
	linux-s390@vger.kernel.org,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH 5/6] mm: migrate: don't split THP for misplaced NUMA page
Date: Tue, 30 Mar 2021 09:53:01 -0700	[thread overview]
Message-ID: <CAHbLzkpQQpvaq=PTCC7+ML8LSan=x9CyB7y9wpO3_7NFJA3tsw@mail.gmail.com> (raw)
In-Reply-To: <20210330164207.3a2826f7@thinkpad>

On Tue, Mar 30, 2021 at 7:42 AM Gerald Schaefer
<gerald.schaefer@linux.ibm.com> wrote:
>
> On Mon, 29 Mar 2021 11:33:11 -0700
> Yang Shi <shy828301@gmail.com> wrote:
>
> > The old behavior didn't split THP if migration is failed due to lack of
> > memory on the target node.  But the THP migration does split THP, so keep
> > the old behavior for misplaced NUMA page migration.
> >
> > Signed-off-by: Yang Shi <shy828301@gmail.com>
> > ---
> >  mm/migrate.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/mm/migrate.c b/mm/migrate.c
> > index 86325c750c14..1c0c873375ab 100644
> > --- a/mm/migrate.c
> > +++ b/mm/migrate.c
> > @@ -1444,6 +1444,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
> >       int swapwrite = current->flags & PF_SWAPWRITE;
> >       int rc, nr_subpages;
> >       LIST_HEAD(ret_pages);
> > +     bool nosplit = (reason == MR_NUMA_MISPLACED);
> >
> >       if (!swapwrite)
> >               current->flags |= PF_SWAPWRITE;
> > @@ -1495,7 +1496,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
> >                        */
> >                       case -ENOSYS:
> >                               /* THP migration is unsupported */
> > -                             if (is_thp) {
> > +                             if (is_thp && !nosplit) {
>
> This is the "THP migration is unsupported" case, but according to your
> description you rather want to change the -ENOMEM case?
>
> Could this be the correct place to trigger THP split for NUMA balancing,
> for architectures not supporting THP migration, like s390?

Yes, I think it could be as I mentioned in the previous email.

>
> Do I understand it correctly that this change (for -ENOSYS) would
> result in always failed THP migrations during NUMA balancing, if THP
> migration was not supported?

Yes.


  reply	other threads:[~2021-03-30 16:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 18:33 [RFC PATCH 0/6] mm: thp: use generic THP migration for NUMA hinting fault Yang Shi
2021-03-29 18:33 ` [PATCH 1/6] mm: memory: add orig_pmd to struct vm_fault Yang Shi
2021-03-29 18:33 ` [PATCH 2/6] mm: memory: make numa_migrate_prep() non-static Yang Shi
2021-03-29 18:33 ` [PATCH 3/6] mm: migrate: teach migrate_misplaced_page() about THP Yang Shi
2021-03-30  0:21   ` Huang, Ying
2021-03-30 16:57     ` Yang Shi
2021-03-29 18:33 ` [PATCH 4/6] mm: thp: refactor NUMA fault handling Yang Shi
2021-03-30  0:41   ` Huang, Ying
2021-03-30 17:02     ` Yang Shi
2021-03-29 18:33 ` [PATCH 5/6] mm: migrate: don't split THP for misplaced NUMA page Yang Shi
2021-03-30 14:42   ` Gerald Schaefer
2021-03-30 16:53     ` Yang Shi [this message]
2021-03-29 18:33 ` [PATCH 6/6] mm: migrate: remove redundant page count check for THP Yang Shi
2021-03-30 14:42 ` [RFC PATCH 0/6] mm: thp: use generic THP migration for NUMA hinting fault Gerald Schaefer
2021-03-30 16:51   ` Yang Shi
2021-03-31 11:47     ` Gerald Schaefer
2021-04-01 20:10       ` Yang Shi
2021-04-06 12:02         ` Gerald Schaefer
2021-04-06 16:42           ` Yang Shi
2021-04-07  8:32             ` Mel Gorman
2021-04-07 16:04               ` Yang Shi
2021-03-31 13:20   ` Mel Gorman
2021-04-01 20:12     ` 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='CAHbLzkpQQpvaq=PTCC7+ML8LSan=x9CyB7y9wpO3_7NFJA3tsw@mail.gmail.com' \
    --to=shy828301@gmail.com \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@de.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=ying.huang@intel.com \
    --cc=ziy@nvidia.com \
    /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