cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpuset: use trialcs->mems_allowed as a temp variable
@ 2015-08-06 14:21 Alban Crequy
       [not found] ` <1438870865-25468-1-git-send-email-alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Alban Crequy @ 2015-08-06 14:21 UTC (permalink / raw)
  To: Tejun Heo, Alban Crequy, cgroups-u79uwXL29TY76Z2rM5mHXA
  Cc: Iago Lopez Galeiras, Li Zefan

The comment says it's using trialcs->mems_allowed as a temp variable but
it didn't match the code. Change the code to match the comment.

This fixes an issue when writing in cpuset.mems when a sub-directory
exists: we need to write several times for the information to persist:

| root@alban:/sys/fs/cgroup/cpuset# mkdir footest9
| root@alban:/sys/fs/cgroup/cpuset# cd footest9
| root@alban:/sys/fs/cgroup/cpuset/footest9# mkdir aa
| root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
|
| root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
| root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
|
| root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
| root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
| 0
| root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
|
| root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > aa/cpuset.mems
| root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
| 0
| root@alban:/sys/fs/cgroup/cpuset/footest9#

This should help to fix the following issue in Docker:
https://github.com/opencontainers/runc/issues/133
In some conditions, a Docker container needs to be started twice in
order to work.

Signed-off-by: Alban Crequy <alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
Tested-by: Iago López Galeiras <iago-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
---
 kernel/cpuset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index ee14e3a..f0acff0 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1223,7 +1223,7 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,
 	spin_unlock_irq(&callback_lock);
 
 	/* use trialcs->mems_allowed as a temp variable */
-	update_nodemasks_hier(cs, &cs->mems_allowed);
+	update_nodemasks_hier(cs, &trialcs->mems_allowed);
 done:
 	return retval;
 }
-- 
2.1.4

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

* Re: [PATCH] cpuset: use trialcs->mems_allowed as a temp variable
       [not found] ` <1438870865-25468-1-git-send-email-alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
@ 2015-08-07 14:59   ` Tejun Heo
       [not found]     ` <20150807145907.GC14626-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
  2015-08-10 15:19   ` Tejun Heo
  1 sibling, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2015-08-07 14:59 UTC (permalink / raw)
  To: Alban Crequy
  Cc: Alban Crequy, cgroups-u79uwXL29TY76Z2rM5mHXA, Iago Lopez Galeiras,
	Li Zefan

On Thu, Aug 06, 2015 at 04:21:05PM +0200, Alban Crequy wrote:
> The comment says it's using trialcs->mems_allowed as a temp variable but
> it didn't match the code. Change the code to match the comment.
> 
> This fixes an issue when writing in cpuset.mems when a sub-directory
> exists: we need to write several times for the information to persist:
> 
> | root@alban:/sys/fs/cgroup/cpuset# mkdir footest9
> | root@alban:/sys/fs/cgroup/cpuset# cd footest9
> | root@alban:/sys/fs/cgroup/cpuset/footest9# mkdir aa
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
> |
> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
> |
> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
> | 0
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
> |
> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > aa/cpuset.mems
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
> | 0
> | root@alban:/sys/fs/cgroup/cpuset/footest9#
> 
> This should help to fix the following issue in Docker:
> https://github.com/opencontainers/runc/issues/133
> In some conditions, a Docker container needs to be started twice in
> order to work.
> 
> Signed-off-by: Alban Crequy <alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
> Tested-by: Iago López Galeiras <iago-973cpzSjLbNWk0Htik3J/w@public.gmane.org>

Li?

-- 
tejun

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

* Re: [PATCH] cpuset: use trialcs->mems_allowed as a temp variable
       [not found]     ` <20150807145907.GC14626-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
@ 2015-08-10 10:25       ` Zefan Li
  0 siblings, 0 replies; 4+ messages in thread
From: Zefan Li @ 2015-08-10 10:25 UTC (permalink / raw)
  To: Tejun Heo, Alban Crequy
  Cc: Alban Crequy, cgroups-u79uwXL29TY76Z2rM5mHXA, Iago Lopez Galeiras

On 2015/8/7 22:59, Tejun Heo wrote:
> On Thu, Aug 06, 2015 at 04:21:05PM +0200, Alban Crequy wrote:
>> The comment says it's using trialcs->mems_allowed as a temp variable but
>> it didn't match the code. Change the code to match the comment.
>>
>> This fixes an issue when writing in cpuset.mems when a sub-directory
>> exists: we need to write several times for the information to persist:
>>
>> | root@alban:/sys/fs/cgroup/cpuset# mkdir footest9
>> | root@alban:/sys/fs/cgroup/cpuset# cd footest9
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# mkdir aa
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
>> |
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
>> |
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
>> | 0
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
>> |
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > aa/cpuset.mems
>> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
>> | 0
>> | root@alban:/sys/fs/cgroup/cpuset/footest9#
>>
>> This should help to fix the following issue in Docker:
>> https://github.com/opencontainers/runc/issues/133
>> In some conditions, a Docker container needs to be started twice in
>> order to work.
>>
>> Signed-off-by: Alban Crequy <alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
>> Tested-by: Iago López Galeiras <iago-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
>
> Li?
>

Acked.

Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # 3.17+

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

* Re: [PATCH] cpuset: use trialcs->mems_allowed as a temp variable
       [not found] ` <1438870865-25468-1-git-send-email-alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
  2015-08-07 14:59   ` Tejun Heo
@ 2015-08-10 15:19   ` Tejun Heo
  1 sibling, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2015-08-10 15:19 UTC (permalink / raw)
  To: Alban Crequy
  Cc: Alban Crequy, cgroups-u79uwXL29TY76Z2rM5mHXA, Iago Lopez Galeiras,
	Li Zefan

On Thu, Aug 06, 2015 at 04:21:05PM +0200, Alban Crequy wrote:
> The comment says it's using trialcs->mems_allowed as a temp variable but
> it didn't match the code. Change the code to match the comment.
> 
> This fixes an issue when writing in cpuset.mems when a sub-directory
> exists: we need to write several times for the information to persist:
> 
> | root@alban:/sys/fs/cgroup/cpuset# mkdir footest9
> | root@alban:/sys/fs/cgroup/cpuset# cd footest9
> | root@alban:/sys/fs/cgroup/cpuset/footest9# mkdir aa
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
> |
> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
> |
> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > cpuset.mems
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat cpuset.mems
> | 0
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
> |
> | root@alban:/sys/fs/cgroup/cpuset/footest9# echo 0 > aa/cpuset.mems
> | root@alban:/sys/fs/cgroup/cpuset/footest9# cat aa/cpuset.mems
> | 0
> | root@alban:/sys/fs/cgroup/cpuset/footest9#
> 
> This should help to fix the following issue in Docker:
> https://github.com/opencontainers/runc/issues/133
> In some conditions, a Docker container needs to be started twice in
> order to work.
> 
> Signed-off-by: Alban Crequy <alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
> Tested-by: Iago López Galeiras <iago-973cpzSjLbNWk0Htik3J/w@public.gmane.org>

Applied to cgroup/for-4.2-fixes w/ stable cc'd.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2015-08-10 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-06 14:21 [PATCH] cpuset: use trialcs->mems_allowed as a temp variable Alban Crequy
     [not found] ` <1438870865-25468-1-git-send-email-alban-973cpzSjLbNWk0Htik3J/w@public.gmane.org>
2015-08-07 14:59   ` Tejun Heo
     [not found]     ` <20150807145907.GC14626-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2015-08-10 10:25       ` Zefan Li
2015-08-10 15:19   ` Tejun Heo

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