linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: migration: pair unlock_page and lock_page when migrating huge pages
@ 2011-11-25 12:20 Hillf Danton
  2011-11-26 17:33 ` Andrea Arcangeli
  0 siblings, 1 reply; 2+ messages in thread
From: Hillf Danton @ 2011-11-25 12:20 UTC (permalink / raw)
  To: Naoya Horiguchi; +Cc: Andrea Arcangeli, Andrew Morton, LKML, linux-mm

Skip unlocking page if fail to lock, then lock and unlock are paired.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/mm/migrate.c	Fri Nov 25 20:11:14 2011
+++ b/mm/migrate.c	Fri Nov 25 20:21:26 2011
@@ -869,9 +869,9 @@ static int unmap_and_move_huge_page(new_

 	if (anon_vma)
 		put_anon_vma(anon_vma);
-out:
 	unlock_page(hpage);

+out:
 	if (rc != -EAGAIN) {
 		list_del(&hpage->lru);
 		put_page(hpage);

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

* Re: [PATCH] mm: migration: pair unlock_page and lock_page when migrating huge pages
  2011-11-25 12:20 [PATCH] mm: migration: pair unlock_page and lock_page when migrating huge pages Hillf Danton
@ 2011-11-26 17:33 ` Andrea Arcangeli
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Arcangeli @ 2011-11-26 17:33 UTC (permalink / raw)
  To: Hillf Danton; +Cc: Naoya Horiguchi, Andrew Morton, LKML, linux-mm

Hi Hillf,

On Fri, Nov 25, 2011 at 08:20:31PM +0800, Hillf Danton wrote:
> Skip unlocking page if fail to lock, then lock and unlock are paired.
> 
> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> ---
> 
> --- a/mm/migrate.c	Fri Nov 25 20:11:14 2011
> +++ b/mm/migrate.c	Fri Nov 25 20:21:26 2011
> @@ -869,9 +869,9 @@ static int unmap_and_move_huge_page(new_
> 
>  	if (anon_vma)
>  		put_anon_vma(anon_vma);
> -out:
>  	unlock_page(hpage);
> 
> +out:
>  	if (rc != -EAGAIN) {
>  		list_del(&hpage->lru);
>  		put_page(hpage);

Looks good, I guess that path wasn't exercised frequently because
there's no blocking I/O involvement with hugetlbfs.

Thanks,
Andrea

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

end of thread, other threads:[~2011-11-26 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-25 12:20 [PATCH] mm: migration: pair unlock_page and lock_page when migrating huge pages Hillf Danton
2011-11-26 17:33 ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).