Re: [RFC PATCH 4/4] mm: madvise allow remove operation for hugetlbfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Now that we have hole punching support for hugetlbfs, we can
> also support the MADV_REMOVE interface to it.
> 
> Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Signed-off-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>
> ---
>  mm/madvise.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/madvise.c b/mm/madvise.c
> index d551475..c4a1027 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -299,7 +299,7 @@ static long madvise_remove(struct vm_area_struct *vma,
> 
>  	*prev = NULL;	/* tell sys_madvise we drop mmap_sem */
> 
> -	if (vma->vm_flags & (VM_LOCKED | VM_HUGETLB))
> +	if (vma->vm_flags & VM_LOCKED)
>  		return -EINVAL;
> 
>  	f = vma->vm_file;
> --
> 2.1.0

After the above change offset is computed,

	offset = (loff_t)(start - vma->vm_start)
		+ ((loff_t)vma->vm_pgoff << PAGE_SHIFT);

and I wonder if it is correct for huge page mapping.

Hillf

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]