Put this on the patch but I'm emailing it as well. On Mon, 2008-03-03 at 23:00 -0800, Roland McGrath wrote:You're quite welcome. Well, the iron is getting bigger, too, so it's beginning to be feasible to run _lots_ of threads. My first patch did essentially what you outlined above, incrementing shared utime/stime/sched_time fields, except that they were in the task_struct of the group leader rather than in the signal_struct. It's not clear to me exactly how the signal_struct is shared, whether it is shared among all threads or if each has its own version. So each timer routine had something like: /* If we're part of a thread group, add our time to the leader. */ if (p->group_leader != NULL) p->group_leader->threads_sched_time += tmp; and check_process_timers() had /* Times for the whole thread group are held by the group leader. */ utime = cputime_add(utime, tsk->group_leader->threads_utime); stime = cputime_add(stime, tsk->group_leader->threads_stime); sched_time += tsk->group_leader->threads_sched_time; Of course, this alone is insufficient. It speeds things up a tiny bit but not nearly enough. The other issue has to do with the rest of the processing in run_posix_cpu_timers(), walking the timer lists and walking the whole thread group (again) to rebalance expiry times. My second patch moved all that work to a workqueue, but only if there were more than 100 threads in the process. This basically papered over the problem by moving the processing out of interrupt and into a kernel thread. It's still insufficient, though, because it takes just as long and will get backed up just as badly on large numbers of threads. This was made clear in a test I ran yesterday where I generated some 200,000 threads. The work queue was unreasonably large, as you might expect. I am looking for a way to do everything that needs to be done in fewer operations, but unfortunately I'm not familiar enough with the SIGPROF/SIGVTALRM semantics or with the details of the Linux implementation to know where it is safe to consolidate things. -- Frank Mayhar <fmayhar@google.com> Google, Inc. --
| Davide Libenzi | [patch 7/8] fdmap v2 - implement sys_socket2 |
| Benjamin Herrenschmidt | Re: [PATCH] Remove process freezer from suspend to RAM pathway |
| Greg Kroah-Hartman | [PATCH 011/196] sysfs: Fix a copy-n-paste typo in comment |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Rémi Denis-Courmont | [PATCH] USB host CDC Phonet network interface driver |
| David Miller | [GIT]: Networking |
git: | |
