linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Felix Kuehling <felix.kuehling@amd.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	Alistair Popple <apopple@nvidia.com>,
	"Yang, Philip" <Philip.Yang@amd.com>
Subject: Re: hmm_range_fault interaction between different drivers
Date: Fri, 22 Jul 2022 12:34:09 -0300	[thread overview]
Message-ID: <20220722153409.GB58735@nvidia.com> (raw)
In-Reply-To: <0d9a7320-e639-ad7b-c45a-644914d73c2e@amd.com>

On Thu, Jul 21, 2022 at 07:00:23PM -0400, Felix Kuehling wrote:
> Hi all,
> 
> We're noticing some unexpected behaviour when the amdgpu and Mellanox
> drivers are interacting on shared memory with hmm_range_fault. If the amdgpu
> driver migrated pages to DEVICE_PRIVATE memory, we would expect
> hmm_range_fault called by the Mellanox driver to fault them back to system
> memory. But that's not happening. Instead hmm_range_fault fails.
> 
> For an experiment, Philip hacked hmm_vma_handle_pte to treat DEVICE_PRIVATE
> pages like device_exclusive pages, which gave us the expected behaviour. It
> would result in a dev_pagemap_ops.migrate_to_ram callback in our driver, and
> hmm_range_fault would return system memory pages to the Mellanox driver.
> 
> So something is clearly wrong. It could be:
> 
>  * our expectations are wrong,
>  * the implementation of hmm_range_fault is wrong, or
>  * our driver is missing something when migrating to DEVICE_PRIVATE memory.
> 
> Do you have any insights?

I think it is a bug

Jason


  reply	other threads:[~2022-07-22 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 23:00 Felix Kuehling
2022-07-22 15:34 ` Jason Gunthorpe [this message]
2022-07-22 16:47   ` Ralph Campbell

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=20220722153409.GB58735@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=Philip.Yang@amd.com \
    --cc=apopple@nvidia.com \
    --cc=felix.kuehling@amd.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox