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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20111128161626.e4be400a.akpm@linux-foundation.org>
Date:	Mon, 28 Nov 2011 16:16:26 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Youquan Song <youquan.song@...el.com>
Cc:	linux-kernel@...r.kernel.org, aarcange@...hat.com,
	wli@...omorphy.com, david.woodhouse@...el.com,
	allen.m.kay@...el.com, mtosatti@...hat.com, chrisw@...hat.com,
	andi@...stfloor.org, chaohong.guo@...el.com,
	Youquan Song <youquan.song@...ux.intel.com>
Subject: Re: [PATCH 1/2] thp: Add compound tail page _mapcount when mapped

On Fri, 25 Nov 2011 13:47:09 +0800
Youquan Song <youquan.song@...el.com> wrote:

> With 3.2-rc kernel, the IOMMU 2M page in KVM works. While I try to us IOMMU
> 1GB page in KVM, I encounter a oops and 1GB page total fail to be used.
> The root cause is that 1GB page allocation calls gup_huge_pud() while 2M
>  page calls gup_huge_pmd. If compound pages are used and the page is tail page,
> gup_huge_pmd increase _mapcount to record tail page are mapped while
> gup_huge_pud does not include this process. So when the mapped page is relesed,
> it will result in kernel oops because the page does not mark mapped.
> 
> This patch add tail process for compound page in 1GB huge page which keeps the
> same process as 2M page.
> 
> Reproduce like:
> 1. Add grub boot option: hugepagesz=1G hugepages=8
> 2. mount -t hugetlbfs -o pagesize=1G hugetlbfs /dev/hugepages
> 3.qemu-kvm -m 2048 -hda os-kvm.img -cpu kvm64 -smp 4 -mem-path /dev/hugepages
>  -net none -device pci-assign,host=07:00.1
> 
> kernel BUG at mm/swap.c:114!
>
> ...
>
> --- a/arch/x86/mm/gup.c
> +++ b/arch/x86/mm/gup.c
> @@ -201,6 +201,8 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr,
>  	do {
>  		VM_BUG_ON(compound_head(page) != head);
>  		pages[*nr] = page;
> +		if (PageTail(page))
> +			get_huge_page_tail(page);
>  		(*nr)++;
>  		page++;
>  		refs++;

Is the patch also applicable to 3.1.x?
--
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