Skip to contentSkip to conversation

rcu: protect fork-time cgroup access

PATCH Matt Helsley 3 participants 3 messages Mar 30, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw
Quoted 17 lines · Peter Zijlstra
Quoted 5 lines · Paul E. McKenney
Quoted 4 lines

And it appears that my patch is at best insufficient:
http://paste.ubuntu.com/406189/

Quoted 8 lines
Quoted 3 lines

Left to myself, I would wrap copy_process() with rcu_read_lock(), but I would rather hear your thoughts before doing too much more semi-random hacking. ;-)

Well, I don't think you can get away with that, copy_process() wants to sleep on quite a few places ;-) Also, locks should be taken at the smallest possible scope, unless we want to go back to BKL style locking :-)

No argument here! ;-)

Quoted 7 lines
Quoted 2 lines

As to that freezer splat, you'd have to chase down the cgroup folks, I'm fully ignorant on that.

K, adding them to CC. The two splats are:

       http://pastebin.ubuntu.com/406131/
        http://paste.ubuntu.com/406189/

Please feel free to Cc me on cgroup freezer stuff.

There's a comment in the code explaining why it's not used in freezer_fork():

/*
* No lock is needed, since the task isn't on tasklist yet,
* so it can't be moved to another cgroup, which means the
* freezer won't be removed and will be valid during this
* function call.
*/
freezer = task_freezer(task);

Cheers,
-Matt Helsley

#2 lore raw
In reply to a message not in the archive
Quoted 29 lines · Matt Helsley
Quoted 17 lines · Peter Zijlstra
Quoted 5 lines · Paul E. McKenney
Quoted 4 lines

And it appears that my patch is at best insufficient:
http://paste.ubuntu.com/406189/

Quoted 8 lines
Quoted 3 lines

Left to myself, I would wrap copy_process() with rcu_read_lock(), but I would rather hear your thoughts before doing too much more semi-random hacking. ;-)

Well, I don't think you can get away with that, copy_process() wants to sleep on quite a few places ;-) Also, locks should be taken at the smallest possible scope, unless we want to go back to BKL style locking :-)

No argument here! ;-)

Quoted 7 lines
Quoted 2 lines

As to that freezer splat, you'd have to chase down the cgroup folks, I'm fully ignorant on that.

K, adding them to CC. The two splats are:

       http://pastebin.ubuntu.com/406131/
        http://paste.ubuntu.com/406189/

Please feel free to Cc me on cgroup freezer stuff.

There's a comment in the code explaining why it's not used in freezer_fork():

Quoted 7 lines

/*
* No lock is needed, since the task isn't on tasklist yet,
* so it can't be moved to another cgroup, which means the
* freezer won't be removed and will be valid during this
* function call.
*/
freezer = task_freezer(task);

Good to know, thank you!

So the cgroup that this task is associated with cannot be deleted in the meantime?

Thanx, Paul

#3 lore raw
In reply to Matt Helsley
Quoted 29 lines · Matt Helsley
Quoted 17 lines · Peter Zijlstra
Quoted 5 lines · Paul E. McKenney
Quoted 4 lines

And it appears that my patch is at best insufficient:
http://paste.ubuntu.com/406189/

Quoted 8 lines
Quoted 3 lines

Left to myself, I would wrap copy_process() with rcu_read_lock(), but I would rather hear your thoughts before doing too much more semi-random hacking. ;-)

Well, I don't think you can get away with that, copy_process() wants to sleep on quite a few places ;-) Also, locks should be taken at the smallest possible scope, unless we want to go back to BKL style locking :-)

No argument here! ;-)

Quoted 7 lines
Quoted 2 lines

As to that freezer splat, you'd have to chase down the cgroup folks, I'm fully ignorant on that.

K, adding them to CC. The two splats are:

       http://pastebin.ubuntu.com/406131/
        http://paste.ubuntu.com/406189/

Please feel free to Cc me on cgroup freezer stuff.

There's a comment in the code explaining why it's not used in freezer_fork():

Quoted 7 lines

/*
* No lock is needed, since the task isn't on tasklist yet,
* so it can't be moved to another cgroup, which means the
* freezer won't be removed and will be valid during this
* function call.
*/
freezer = task_freezer(task);

Good to know, thank you!

So the cgroup that this task is associated with cannot be deleted in the meantime?

Thanx, Paul