linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, <linux-mm@kvack.org>,
	Ralph Campbell <rcampbell@nvidia.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David (ChunMing) Zhou" <David1.Zhou@amd.com>,
	dri-devel@lists.freedesktop.org,
	"Felix Kuehling" <Felix.Kuehling@amd.com>,
	"Christoph Hellwig" <hch@lst.de>,
	intel-gfx@lists.freedesktop.org,
	"Jérôme Glisse" <jglisse@redhat.com>,
	linux-kernel@vger.kernel.org,
	"Niranjana Vishwanathapura" <niranjana.vishwanathapura@intel.com>,
	nouveau@lists.freedesktop.org, "Yang,
	Philip" <Philip.Yang@amd.com>
Subject: Re: [PATCH hmm v2 4/5] mm/hmm: remove HMM_PFN_SPECIAL
Date: Mon, 4 May 2020 17:23:46 -0700	[thread overview]
Message-ID: <11e39f2e-e244-a75f-15f4-83d2f5dd2f26@nvidia.com> (raw)
In-Reply-To: <4-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com>

On 2020-05-01 11:20, Jason Gunthorpe wrote:
> From: Jason Gunthorpe <jgg@mellanox.com>
> 
> This is just an alias for HMM_PFN_ERROR, nothing cares that the error was
> because of a special page vs any other error case.

Reviewed-by: John Hubbard <jhubbard@nvidia.com>

thanks,
-- 
John Hubbard
NVIDIA
> 
> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 -
>   drivers/gpu/drm/nouveau/nouveau_svm.c   | 1 -
>   include/linux/hmm.h                     | 8 --------
>   mm/hmm.c                                | 2 +-
>   4 files changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 41ae7f96f48194..76b4a4fa39ed04 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -775,7 +775,6 @@ static const uint64_t hmm_range_flags[HMM_PFN_FLAG_MAX] = {
>   static const uint64_t hmm_range_values[HMM_PFN_VALUE_MAX] = {
>   	0xfffffffffffffffeUL, /* HMM_PFN_ERROR */
>   	0, /* HMM_PFN_NONE */
> -	0xfffffffffffffffcUL /* HMM_PFN_SPECIAL */
>   };
>   
>   /**
> diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c
> index c68e9317cf0740..cf0d9bd61bebf9 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_svm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c
> @@ -379,7 +379,6 @@ static const u64
>   nouveau_svm_pfn_values[HMM_PFN_VALUE_MAX] = {
>   	[HMM_PFN_ERROR  ] = ~NVIF_VMM_PFNMAP_V0_V,
>   	[HMM_PFN_NONE   ] =  NVIF_VMM_PFNMAP_V0_NONE,
> -	[HMM_PFN_SPECIAL] = ~NVIF_VMM_PFNMAP_V0_V,
>   };
>   
>   /* Issue fault replay for GPU to retry accesses that faulted previously. */
> diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> index 0df27dd03d53d7..81c302c884c0e3 100644
> --- a/include/linux/hmm.h
> +++ b/include/linux/hmm.h
> @@ -44,10 +44,6 @@ enum hmm_pfn_flag_e {
>    * Flags:
>    * HMM_PFN_ERROR: corresponding CPU page table entry points to poisoned memory
>    * HMM_PFN_NONE: corresponding CPU page table entry is pte_none()
> - * HMM_PFN_SPECIAL: corresponding CPU page table entry is special; i.e., the
> - *      result of vmf_insert_pfn() or vm_insert_page(). Therefore, it should not
> - *      be mirrored by a device, because the entry will never have HMM_PFN_VALID
> - *      set and the pfn value is undefined.
>    *
>    * Driver provides values for none entry, error entry, and special entry.
>    * Driver can alias (i.e., use same value) error and special, but
> @@ -56,12 +52,10 @@ enum hmm_pfn_flag_e {
>    * HMM pfn value returned by hmm_vma_get_pfns() or hmm_vma_fault() will be:
>    * hmm_range.values[HMM_PFN_ERROR] if CPU page table entry is poisonous,
>    * hmm_range.values[HMM_PFN_NONE] if there is no CPU page table entry,
> - * hmm_range.values[HMM_PFN_SPECIAL] if CPU page table entry is a special one
>    */
>   enum hmm_pfn_value_e {
>   	HMM_PFN_ERROR,
>   	HMM_PFN_NONE,
> -	HMM_PFN_SPECIAL,
>   	HMM_PFN_VALUE_MAX
>   };
>   
> @@ -110,8 +104,6 @@ static inline struct page *hmm_device_entry_to_page(const struct hmm_range *rang
>   		return NULL;
>   	if (entry == range->values[HMM_PFN_ERROR])
>   		return NULL;
> -	if (entry == range->values[HMM_PFN_SPECIAL])
> -		return NULL;
>   	if (!(entry & range->flags[HMM_PFN_VALID]))
>   		return NULL;
>   	return pfn_to_page(entry >> range->pfn_shift);
> diff --git a/mm/hmm.c b/mm/hmm.c
> index f06bcac948a79b..2e975eedb14f89 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -301,7 +301,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
>   			pte_unmap(ptep);
>   			return -EFAULT;
>   		}
> -		*pfn = range->values[HMM_PFN_SPECIAL];
> +		*pfn = range->values[HMM_PFN_ERROR];
>   		return 0;
>   	}
>   
> 



  reply	other threads:[~2020-05-05  0:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 18:20 [PATCH hmm v2 0/5] Adjust hmm_range_fault() API Jason Gunthorpe
2020-05-01 18:20 ` [PATCH hmm v2 1/5] mm/hmm: make CONFIG_DEVICE_PRIVATE into a select Jason Gunthorpe
2020-05-02  5:47   ` John Hubbard
2020-05-10  0:16   ` Andrew Morton
2020-05-11 13:49     ` Jason Gunthorpe
2020-05-01 18:20 ` [PATCH hmm v2 2/5] mm/hmm: make hmm_range_fault return 0 or -1 Jason Gunthorpe
2020-05-05  0:20   ` John Hubbard
2020-05-01 18:20 ` [PATCH hmm v2 3/5] drm/amdgpu: remove dead code after hmm_range_fault() Jason Gunthorpe
2020-05-01 18:20 ` [PATCH hmm v2 4/5] mm/hmm: remove HMM_PFN_SPECIAL Jason Gunthorpe
2020-05-05  0:23   ` John Hubbard [this message]
2020-05-01 18:20 ` [PATCH hmm v2 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault Jason Gunthorpe
2020-05-02  0:53   ` Ralph Campbell
2020-05-06 16:18     ` Jason Gunthorpe
2020-05-04 13:14   ` Christoph Hellwig
2020-05-05  1:30   ` John Hubbard
2020-05-06 16:21     ` Jason Gunthorpe
2020-05-06 18:45 ` [PATCH hmm v2 0/5] Adjust hmm_range_fault() API Jason Gunthorpe

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=11e39f2e-e244-a75f-15f4-83d2f5dd2f26@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=David1.Zhou@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Philip.Yang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jgg@ziepe.ca \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=niranjana.vishwanathapura@intel.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rcampbell@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