linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Alistair Popple <apopple@nvidia.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Cc: dri-devel@lists.freedesktop.org,
	Ralph Campbell <rcampbell@nvidia.com>,
	John Hubbard <jhubbard@nvidia.com>,
	Alex Sierra <alex.sierra@amd.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Lyude Paul <lyude@redhat.com>, Jason Gunthorpe <jgg@nvidia.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH] mm/memory: Return vm_fault_t result from migrate_to_ram() callback
Date: Mon, 14 Nov 2022 17:41:02 +0100	[thread overview]
Message-ID: <f9826c72-7265-7c6f-371b-7ebab4aa27e0@redhat.com> (raw)
In-Reply-To: <20221114115537.727371-1-apopple@nvidia.com>

On 14.11.22 12:55, Alistair Popple wrote:
> The migrate_to_ram() callback should always succeed, but in rare cases
> can fail usually returning VM_FAULT_SIGBUS. Commit 16ce101db85d
> ("mm/memory.c: fix race when faulting a device private page")
> incorrectly stopped passing the return code up the stack. Fix this by
> setting the ret variable, restoring the previous behaviour on
> migrate_to_ram() failure.
> 
> Fixes: 16ce101db85d ("mm/memory.c: fix race when faulting a device private page")
> Signed-off-by: Alistair Popple <apopple@nvidia.com>
> Cc: Ralph Campbell <rcampbell@nvidia.com>
> Cc: John Hubbard <jhubbard@nvidia.com>
> Cc: Alex Sierra <alex.sierra@amd.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Felix Kuehling <Felix.Kuehling@amd.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> 
> ---
> 
> Hi Andrew, I noticed my series needs another small fix which I'm
> hoping you can apply for v6.1-rcX. Thanks (and sorry for not catching
> this sooner).
> ---
>   mm/memory.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index f88c351aecd4..8a6d5c823f91 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3763,7 +3763,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
>   			 */
>   			get_page(vmf->page);
>   			pte_unmap_unlock(vmf->pte, vmf->ptl);
> -			vmf->page->pgmap->ops->migrate_to_ram(vmf);
> +			ret = vmf->page->pgmap->ops->migrate_to_ram(vmf);
>   			put_page(vmf->page);
>   		} else if (is_hwpoison_entry(entry)) {
>   			ret = VM_FAULT_HWPOISON;


Acked-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2022-11-14 16:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 11:55 Alistair Popple
2022-11-14 16:41 ` David Hildenbrand [this message]
2022-11-14 17:26   ` Felix Kuehling

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=f9826c72-7265-7c6f-371b-7ebab4aa27e0@redhat.com \
    --to=david@redhat.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.sierra@amd.com \
    --cc=apopple@nvidia.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-mm@kvack.org \
    --cc=lyude@redhat.com \
    --cc=mpe@ellerman.id.au \
    --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