[PATCH] mm/hmm: hmm_range_fault handle pages swapped out

Jason Gunthorpe jgg at mellanox.com
Fri Aug 23 13:39:53 UTC 2019


On Thu, Aug 15, 2019 at 08:52:56PM +0000, Yang, Philip wrote:
> hmm_range_fault may return NULL pages because some of pfns are equal to
> HMM_PFN_NONE. This happens randomly under memory pressure. The reason is
> for swapped out page pte path, hmm_vma_handle_pte doesn't update fault
> variable from cpu_flags, so it failed to call hmm_vam_do_fault to swap
> the page in.
> 
> The fix is to call hmm_pte_need_fault to update fault variable.
> 
> Change-Id: I2e8611485563d11d938881c18b7935fa1e7c91ee
> Signed-off-by: Philip Yang <Philip.Yang at amd.com>
>  mm/hmm.c | 3 +++
>  1 file changed, 3 insertions(+)

Applied to hmm.git, thanks

I fixed the commit message:

Author: Yang, Philip <Philip.Yang at amd.com>
Date:   Thu Aug 15 20:52:56 2019 +0000

    mm/hmm: fix hmm_range_fault()'s handling of swapped out pages
    
    hmm_range_fault() may return NULL pages because some of the pfns are equal
    to HMM_PFN_NONE. This happens randomly under memory pressure. The reason
    is during the swapped out page pte path, hmm_vma_handle_pte() doesn't
    update the fault variable from cpu_flags, so it failed to call
    hmm_vam_do_fault() to swap the page in.
    
    The fix is to call hmm_pte_need_fault() to update fault variable.
    
    Fixes: 74eee180b935 ("mm/hmm/mirror: device page fault handler")
    Link: https://lore.kernel.org/r/20190815205227.7949-1-Philip.Yang@amd.com
    Signed-off-by: Philip Yang <Philip.Yang at amd.com>
    Reviewed-by: "Jérôme Glisse" <jglisse at redhat.com>
    Signed-off-by: Jason Gunthorpe <jgg at mellanox.com>


More information about the amd-gfx mailing list