Re: [PATCH] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()
From: David Rientjes
Date: Mon May 21 2018 - 17:16:26 EST
On Mon, 21 May 2018, Song Liu wrote:
> khugepaged_enter_vma_merge() is using a different approach to check
> whether a vma is valid for khugepaged_enter():
>
> if (!vma->anon_vma)
> /*
> * Not yet faulted in so we will register later in the
> * page fault if needed.
> */
> return 0;
> if (vma->vm_ops || (vm_flags & VM_NO_KHUGEPAGED))
> /* khugepaged not yet working on file or special mappings */
> return 0;
>
> This check has some problems. One of the obvious problems is that
> it doesn't check shmem_file(), so that vma backed with shmem files
> will not call khugepaged_enter().
>
> This patch fixes these problems by reusing hugepage_vma_check() in
> khugepaged_enter_vma_merge().
>
> Signed-off-by: Song Liu <songliubraving@xxxxxx>
Acked-by: David Rientjes <rientjes@xxxxxxxxxx>