lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <00ef01d078dd$96bfc480$c43f4d80$@alibaba-inc.com>
Date:	Fri, 17 Apr 2015 15:10:29 +0800
From:	"Hillf Danton" <hillf.zj@...baba-inc.com>
To:	"'Dave Hansen'" <dave.hansen@...ux.intel.com>,
	"'Mike Kravetz'" <mike.kravetz@...cle.com>
Cc:	"linux-kernel" <linux-kernel@...r.kernel.org>,
	<linux-mm@...ck.org>, "Michal Hocko" <mhocko@...e.cz>
Subject: Re: [RFC PATCH 4/4] mm: madvise allow remove operation for hugetlbfs

> 
> 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@...ux.intel.com>
> Signed-off-by: Mike Kravetz <mike.kravetz@...cle.com>
> ---
>  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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ