On Sat, 6 Oct 2007, Paul Jackson wrote:Use the struct task_struct **tasks above. Any call here should only be about 300 bytes into the stack so, with 8K stacks on x86_64, you should be able to store pointers to a little under 1,000 tasks before corrupting it. Or, if you think there's going to be more than 1,000 tasks in this cgroup, just do an arbitrary number of them and then reuse your stack before calling set_cpus_allowed() and put_task_struct() on all tasks you've collected so far; then finally call cgroup_iter_end() when you're done with all of them. Use the task_struct usage counter as your locking so that tasks don't prematurely exit or deallocate before you migrate them. Keep in mind that simply iterating over the tasks and using set_cpus_allowed() isn't good enough not only because you're holding a spinlock but also because the task can exit during the call, unless you're using some sort of cgroups locking I'm not aware of that prevents that. My solution prevents that with {get,put}_task_struct(). The current update_cpu_domains(), or -mm's equivalent of it with this patchset, cannot call lock_cpu_hotplug() with callback_mutex held, so it'll need to be unlocked after all the tasks have been put. If you're preempted here before update_cpu_domains(), attach_task() will take care of the cpus_allowed reassignment. David -
| Andy Whitcroft | Re: 2.6.23-rc6-mm1 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Alan | Re: [RFC] Heads up on sys_fallocate() |
git: | |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Winkler, Tomas | RE: iwlwifi: fix build bug in "iwlwifi: fix LED stall" |
