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: <20130827075838.GC6795@lge.com>
Date:	Tue, 27 Aug 2013 16:58:38 +0900
From:	Joonsoo Kim <iamjoonsoo.kim@....com>
To:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>, Mel Gorman <mgorman@...e.de>,
	Michal Hocko <mhocko@...e.cz>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Hugh Dickins <hughd@...gle.com>,
	Davidlohr Bueso <davidlohr.bueso@...com>,
	David Gibson <david@...son.dropbear.id.au>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Wanpeng Li <liwanp@...ux.vnet.ibm.com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Hillf Danton <dhillf@...il.com>
Subject: Re: [PATCH v2 14/20] mm, hugetlb: call vma_needs_reservation before
 entering alloc_huge_page()

> >> @@ -2504,6 +2498,8 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
> >>  	struct hstate *h = hstate_vma(vma);
> >>  	struct page *old_page, *new_page;
> >>  	int outside_reserve = 0;
> >> +	long chg;
> >> +	bool use_reserve;
> >>  	unsigned long mmun_start;	/* For mmu_notifiers */
> >>  	unsigned long mmun_end;		/* For mmu_notifiers */
> >>
> >> @@ -2535,7 +2531,17 @@ retry_avoidcopy:
> >>
> >>  	/* Drop page_table_lock as buddy allocator may be called */
> >>  	spin_unlock(&mm->page_table_lock);
> >> -	new_page = alloc_huge_page(vma, address, outside_reserve);
> >> +	chg = vma_needs_reservation(h, vma, address);
> >> +	if (chg == -ENOMEM) {
> >
> > why not 
> >
> >     if (chg < 0) ?
> >
> > Should we try to unmap the page from child and avoid cow here ?. May be
> > with outside_reserve = 1 we will never have vma_needs_reservation fail.
> > Any how it would be nice to document why this error case is different
> > from alloc_huge_page error case.
> >
> 
> I guess patch  16 address this . So if we do if (chg < 0) we are good
> here.

Okay! I will change it.

> 
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>

Thanks.

--
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