On Sat, 6 Oct 2007, Paul Jackson wrote:It would probably be better to just save references to the tasks. struct cgroup_iter it; struct task_struct *p, **tasks; int i = 0; cgroup_iter_start(cs->css.cgroup, &it); while ((p = cgroup_iter_next(cs->css.cgroup, &it))) { get_task_struct(p); tasks[i++] = p; } cgroup_iter_end(cs->css.cgroup, &it); while (--i >= 0) { set_cpus_allowed(tasks[i], cs->cpus_allowed); put_task_struct(tasks[i]); } The getting and putting of the tasks will prevent them from exiting or being deallocated prematurely. But this is also a critical section that will need to be protected by some mutex so it doesn't race with other set_cpus_allowed(). David -
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Andy Whitcroft | Re: 2.6.23-rc6-mm1 |
| Dave Johnson | expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device? |
| Anton Salikhmetov | [PATCH -v8 2/4] Update ctime and mtime for memory-mapped files |
git: | |
| Stephen Hemminger | git pull for update of netdev fails. |
| pavlix | GIT push to sftp (feature request) |
| Wincent Colaiuta | Possible to make a totally empty repository for remote access? |
| Andrew Morton | Untracked working tree files |
| Richard Stallman | Real men don't attack straw men |
| Aaron W. Hsu | Re: sudo & wheel group |
| Jason Dixon | Wasting our Freedom |
| Alex Thurlow | Router performance on OpenBSD and OpenBGPD |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Marc Pignat | Re: [PATCH] phylib: make mdio-gpio work without OF (v2) |
| Andrew Morton | Re: [Bugme-new] [Bug 11865] New: WOL for E100 Doesn't Work Anymore |
| Jeff Kirsher | [PATCH 1/3] e1000e: add support for the 82567LM-4 device |
| VPN's on NetBSD | 11 hours ago | NetBSD |
| Why does uClinux 2.6.18 bootup block SuperIO UART IRQs that BIOS configured | 12 hours ago | Linux kernel |
| USB statistics | 14 hours ago | Linux kernel |
| Block Sub System query | 18 hours ago | Linux kernel |
| kernel module to intercept socket creation | 19 hours ago | Linux kernel |
| Image size changing during each build | 19 hours ago | Linux kernel |
| Soft lock bug | 1 day ago | Linux kernel |
| sysctl - dynamic registration problem | 1 day ago | Linux kernel |
| Question on swap as ramdisk partition | 1 day ago | Linux kernel |
| serial driver xmit problem | 1 day ago | Linux kernel |
