linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, hugetlb: Fix a double unlock bug in alloc_surplus_huge_page()
@ 2018-01-09 20:06 Dan Carpenter
  2018-01-10 10:14 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-01-09 20:06 UTC (permalink / raw)
  To: Andrew Morton, Michal Hocko
  Cc: Mike Kravetz, Naoya Horiguchi, Stephen Rothwell, Punit Agrawal,
	Aneesh Kumar K.V, Andrea Arcangeli, linux-mm, kernel-janitors

We aren't holding the hugetlb_lock so there is no need to unlock.

Fixes: b27f11e5e675 ("mm, hugetlb: get rid of surplus page accounting tricks")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index ffcae114ceed..742a929f2311 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1567,7 +1567,7 @@ static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask,
 
 	page = alloc_fresh_huge_page(h, gfp_mask, nid, nmask);
 	if (!page)
-		goto out_unlock;
+		return NULL;
 
 	spin_lock(&hugetlb_lock);
 	/*

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm, hugetlb: Fix a double unlock bug in alloc_surplus_huge_page()
  2018-01-09 20:06 [PATCH] mm, hugetlb: Fix a double unlock bug in alloc_surplus_huge_page() Dan Carpenter
@ 2018-01-10 10:14 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2018-01-10 10:14 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Andrew Morton, Mike Kravetz, Naoya Horiguchi, Stephen Rothwell,
	Punit Agrawal, Aneesh Kumar K.V, Andrea Arcangeli, linux-mm,
	kernel-janitors

On Tue 09-01-18 23:06:00, Dan Carpenter wrote:
> We aren't holding the hugetlb_lock so there is no need to unlock.
> 
> Fixes: b27f11e5e675 ("mm, hugetlb: get rid of surplus page accounting tricks")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Ups, a left over after refactoring. Andrew, could you fold this into
mm-hugetlb-further-simplify-hugetlb-allocation-api.patch please?
 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index ffcae114ceed..742a929f2311 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1567,7 +1567,7 @@ static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask,
>  
>  	page = alloc_fresh_huge_page(h, gfp_mask, nid, nmask);
>  	if (!page)
> -		goto out_unlock;
> +		return NULL;
>  
>  	spin_lock(&hugetlb_lock);
>  	/*

-- 
Michal Hocko
SUSE Labs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-10 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 20:06 [PATCH] mm, hugetlb: Fix a double unlock bug in alloc_surplus_huge_page() Dan Carpenter
2018-01-10 10:14 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox