OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] fix spurious EBUSY on memory cgroup removal
[PATCH] fix spurious EBUSY on memory cgroup removal [message #26795] Fri, 01 February 2008 03:46 Go to next message
yamamoto is currently offline  yamamoto
Messages: 97
Registered: July 2007
Member
hi,

the following patch is to fix spurious EBUSY on cgroup removal.

YAMAMOTO Takashi


call mm_free_cgroup earlier.
otherwise a reference due to lazy mm switching can prevent cgroup removal.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
---

--- linux-2.6.24-rc8-mm1/kernel/fork.c.BACKUP	2008-01-23 14:43:29.000000000 +0900
+++ linux-2.6.24-rc8-mm1/kernel/fork.c	2008-01-31 17:26:31.000000000 +0900
@@ -393,7 +393,6 @@ void __mmdrop(struct mm_struct *mm)
 {
 	BUG_ON(mm == &init_mm);
 	mm_free_pgd(mm);
-	mm_free_cgroup(mm);
 	destroy_context(mm);
 	free_mm(mm);
 }
@@ -415,6 +414,7 @@ void mmput(struct mm_struct *mm)
 			spin_unlock(&mmlist_lock);
 		}
 		put_swap_token(mm);
+		mm_free_cgroup(mm);
 		mmdrop(mm);
 	}
 }
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH] fix spurious EBUSY on memory cgroup removal [message #26827 is a reply to message #26795] Sat, 02 February 2008 04:10 Go to previous message
Balbir Singh is currently offline  Balbir Singh
Messages: 491
Registered: August 2006
Senior Member
YAMAMOTO Takashi wrote:
> hi,
> 
> the following patch is to fix spurious EBUSY on cgroup removal.
> 
> YAMAMOTO Takashi
> 
> 
> call mm_free_cgroup earlier.
> otherwise a reference due to lazy mm switching can prevent cgroup removal.
> 
> Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
> ---
> 
> --- linux-2.6.24-rc8-mm1/kernel/fork.c.BACKUP	2008-01-23 14:43:29.000000000 +0900
> +++ linux-2.6.24-rc8-mm1/kernel/fork.c	2008-01-31 17:26:31.000000000 +0900
> @@ -393,7 +393,6 @@ void __mmdrop(struct mm_struct *mm)
>  {
>  	BUG_ON(mm == &init_mm);
>  	mm_free_pgd(mm);
> -	mm_free_cgroup(mm);
>  	destroy_context(mm);
>  	free_mm(mm);
>  }
> @@ -415,6 +414,7 @@ void mmput(struct mm_struct *mm)
>  			spin_unlock(&mmlist_lock);
>  		}
>  		put_swap_token(mm);
> +		mm_free_cgroup(mm);
>  		mmdrop(mm);
>  	}
>  }

The difference I see with the change is that mmput() will now call
mm_free_cgroup() when mm->mm_users drop to 0 and __mmdrop() will call it when
mm->mm_count drops to 0.

I think this change makes sense

Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [PATCH 0/12] Schedule find_task_by_pid() for removal
Next Topic: [PATCH 3/4] Clean up the kill_someting_info
Goto Forum:
  


Current Time: Fri Jul 19 21:21:31 GMT 2024

Total time taken to generate the page: 0.02445 seconds