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: <20101129143801.abef5228.nishimura@mxp.nes.nec.co.jp>
Date:	Mon, 29 Nov 2010 14:38:01 +0900
From:	Daisuke Nishimura <nishimura@....nes.nec.co.jp>
To:	Andrea Arcangeli <aarcange@...hat.com>
Cc:	linux-mm@...ck.org, Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org,
	Marcelo Tosatti <mtosatti@...hat.com>,
	Adam Litke <agl@...ibm.com>, Avi Kivity <avi@...hat.com>,
	Hugh Dickins <hugh.dickins@...cali.co.uk>,
	Rik van Riel <riel@...hat.com>, Mel Gorman <mel@....ul.ie>,
	Dave Hansen <dave@...ux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Ingo Molnar <mingo@...e.hu>, Mike Travis <travis@....com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Christoph Lameter <cl@...ux-foundation.org>,
	Chris Wright <chrisw@...s-sol.org>, bpicco@...hat.com,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	"Michael S. Tsirkin" <mst@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Johannes Weiner <hannes@...xchg.org>,
	Chris Mason <chris.mason@...cle.com>,
	Borislav Petkov <bp@...en8.de>,
	Daisuke Nishimura <nishimura@....nes.nec.co.jp>
Subject: Re: [PATCH 53 of 66] add numa awareness to hugepage allocations

> @@ -1655,7 +1672,11 @@ static void collapse_huge_page(struct mm
>  	unsigned long hstart, hend;
>  
>  	VM_BUG_ON(address & ~HPAGE_PMD_MASK);
> +#ifndef CONFIG_NUMA
>  	VM_BUG_ON(!*hpage);
> +#else
> +	VM_BUG_ON(*hpage);
> +#endif
>  
>  	/*
>  	 * Prevent all access to pagetables with the exception of
> @@ -1693,7 +1714,15 @@ static void collapse_huge_page(struct mm
>  	if (!pmd_present(*pmd) || pmd_trans_huge(*pmd))
>  		goto out;
>  
> +#ifndef CONFIG_NUMA
>  	new_page = *hpage;
> +#else
> +	new_page = alloc_hugepage_vma(khugepaged_defrag(), vma, address);
> +	if (unlikely(!new_page)) {
> +		*hpage = ERR_PTR(-ENOMEM);
> +		goto out;
> +	}
> +#endif
>  	if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL)))
>  		goto out;
>  
I think this should be:

	if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
#ifdef CONFIG_NUMA
		put_page(new_page);
#endif
		goto out;
	}

Thanks,
Daisuke Nishimura.

> @@ -1724,6 +1753,9 @@ static void collapse_huge_page(struct mm
>  		spin_unlock(&mm->page_table_lock);
>  		anon_vma_unlock(vma->anon_vma);
>  		mem_cgroup_uncharge_page(new_page);
> +#ifdef CONFIG_NUMA
> +		put_page(new_page);
> +#endif
>  		goto out;
>  	}
>  
> @@ -1759,7 +1791,9 @@ static void collapse_huge_page(struct mm
>  	mm->nr_ptes--;
>  	spin_unlock(&mm->page_table_lock);
>  
> +#ifndef CONFIG_NUMA
>  	*hpage = NULL;
> +#endif
>  	khugepaged_pages_collapsed++;
>  out:
>  	up_write(&mm->mmap_sem);
--
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