From: Jerome Glisse <jglisse@redhat.com>
To: "Kuehling, Felix" <Felix.Kuehling@amd.com>
Cc: "Yang, Philip" <Philip.Yang@amd.com>,
"alex.deucher@amd.com" <alex.deucher@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] mm/hmm: support automatic NUMA balancing
Date: Fri, 10 May 2019 16:13:32 -0400 [thread overview]
Message-ID: <20190510201331.GF4507@redhat.com> (raw)
In-Reply-To: <20190510195258.9930-2-Felix.Kuehling@amd.com>
On Fri, May 10, 2019 at 07:53:23PM +0000, Kuehling, Felix wrote:
> From: Philip Yang <Philip.Yang@amd.com>
>
> While the page is migrating by NUMA balancing, HMM failed to detect this
> condition and still return the old page. Application will use the new
> page migrated, but driver pass the old page physical address to GPU,
> this crash the application later.
>
> Use pte_protnone(pte) to return this condition and then hmm_vma_do_fault
> will allocate new page.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Jérôme Glisse <jglisse@redhat.com>
> ---
> mm/hmm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/hmm.c b/mm/hmm.c
> index 75d2ea906efb..b65c27d5c119 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -554,7 +554,7 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk,
>
> static inline uint64_t pte_to_hmm_pfn_flags(struct hmm_range *range, pte_t pte)
> {
> - if (pte_none(pte) || !pte_present(pte))
> + if (pte_none(pte) || !pte_present(pte) || pte_protnone(pte))
> return 0;
> return pte_write(pte) ? range->flags[HMM_PFN_VALID] |
> range->flags[HMM_PFN_WRITE] :
> --
> 2.17.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jerome Glisse <jglisse@redhat.com>
To: "Kuehling, Felix" <Felix.Kuehling@amd.com>
Cc: "alex.deucher@amd.com" <alex.deucher@amd.com>,
"airlied@gmail.com" <airlied@gmail.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"Yang, Philip" <Philip.Yang@amd.com>
Subject: Re: [PATCH 1/2] mm/hmm: support automatic NUMA balancing
Date: Fri, 10 May 2019 16:13:32 -0400 [thread overview]
Message-ID: <20190510201331.GF4507@redhat.com> (raw)
In-Reply-To: <20190510195258.9930-2-Felix.Kuehling@amd.com>
On Fri, May 10, 2019 at 07:53:23PM +0000, Kuehling, Felix wrote:
> From: Philip Yang <Philip.Yang@amd.com>
>
> While the page is migrating by NUMA balancing, HMM failed to detect this
> condition and still return the old page. Application will use the new
> page migrated, but driver pass the old page physical address to GPU,
> this crash the application later.
>
> Use pte_protnone(pte) to return this condition and then hmm_vma_do_fault
> will allocate new page.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Jérôme Glisse <jglisse@redhat.com>
> ---
> mm/hmm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/hmm.c b/mm/hmm.c
> index 75d2ea906efb..b65c27d5c119 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -554,7 +554,7 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk,
>
> static inline uint64_t pte_to_hmm_pfn_flags(struct hmm_range *range, pte_t pte)
> {
> - if (pte_none(pte) || !pte_present(pte))
> + if (pte_none(pte) || !pte_present(pte) || pte_protnone(pte))
> return 0;
> return pte_write(pte) ? range->flags[HMM_PFN_VALID] |
> range->flags[HMM_PFN_WRITE] :
> --
> 2.17.1
>
next prev parent reply other threads:[~2019-05-10 20:13 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 19:53 [PATCH 0/2] Two bug-fixes for HMM Kuehling, Felix
2019-05-10 19:53 ` Kuehling, Felix
[not found] ` <20190510195258.9930-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2019-05-10 19:53 ` [PATCH 1/2] mm/hmm: support automatic NUMA balancing Kuehling, Felix
2019-05-10 19:53 ` Kuehling, Felix
2019-05-10 20:13 ` Jerome Glisse [this message]
2019-05-10 20:13 ` Jerome Glisse
2019-05-13 21:27 ` Andrew Morton
2019-05-13 21:27 ` Andrew Morton
[not found] ` <20190513142720.3334a98cbabaae67b4ffbb5a-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2019-05-13 22:37 ` Jerome Glisse
2019-05-13 22:37 ` Jerome Glisse
2019-05-14 21:14 ` Kuehling, Felix
2019-05-14 21:14 ` Kuehling, Felix
2019-05-10 19:53 ` [PATCH 2/2] mm/hmm: Only set FAULT_FLAG_ALLOW_RETRY for non-blocking Kuehling, Felix
2019-05-10 19:53 ` Kuehling, Felix
[not found] ` <20190510195258.9930-3-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2019-05-10 20:14 ` Jerome Glisse
2019-05-10 20:14 ` Jerome Glisse
[not found] ` <20190510201403.GG4507-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-05-13 19:36 ` Kuehling, Felix
2019-05-13 19:36 ` Kuehling, Felix
[not found] ` <65328381-aa0d-353d-68dc-81060e7cebdf-5C7GfCeVMHo@public.gmane.org>
2019-05-13 19:49 ` Jerome Glisse
2019-05-13 19:49 ` Jerome Glisse
[not found] ` <20190513194925.GA31365-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-05-13 20:31 ` Kuehling, Felix
2019-05-13 20:31 ` Kuehling, Felix
2019-05-13 20:21 ` Deucher, Alexander
2019-05-13 20:21 ` Deucher, Alexander
[not found] ` <BN6PR12MB1809F26E6AF74BE9F96DB22DF70F0-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-05-14 21:12 ` Kuehling, Felix
2019-05-14 21:12 ` Kuehling, Felix
2019-05-14 21:58 ` Alex Deucher
2019-05-14 21:58 ` Alex Deucher
2019-06-06 15:11 ` [PATCH 0/2] Two bug-fixes for HMM Jason Gunthorpe
2019-06-06 15:11 ` Jason Gunthorpe
[not found] ` <20190606151149.GA5506-uk2M96/98Pc@public.gmane.org>
2019-06-06 19:04 ` Kuehling, Felix
2019-06-06 19:04 ` Kuehling, Felix
[not found] ` <1d309300-41d8-eb31-38c2-c6c9dd5c0ba8-5C7GfCeVMHo@public.gmane.org>
2019-06-06 19:20 ` Jason Gunthorpe
2019-06-06 19:20 ` Jason Gunthorpe
2019-06-06 19:16 ` Kuehling, Felix
2019-06-06 19:16 ` Kuehling, Felix
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=20190510201331.GF4507@redhat.com \
--to=jglisse@redhat.com \
--cc=Felix.Kuehling@amd.com \
--cc=Philip.Yang@amd.com \
--cc=alex.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-mm@kvack.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.