On Fri, 23 Jun 2006 22:59:04 -0400 Shailabh Nagar <[email protected]> wrote: > >>It was due to a loop in fill_tgid() when per-TG stats > >>data are assembled for netlink: > >> do { > >> rc = delayacct_add_tsk(stats, tsk); > >> if (rc) > >> break; > >> > >> } while_each_thread(first, tsk); > >> > >>and it is executed inside a lock. > >>Fortunately single threaded appls do not hit this code. > >> > >> > > > >Am I reading this right? We do that loop when each thread within the > >thread group exits? > > > Yes. > > > How come? > > > > > To get the sum of all per-tid data for threads that are currently alive. > This is returned to userspace with each thread exit. I realise that. How about we stop doing it? When a thread exits it only makes sense to send up the stats for that thread. Why does the kernel assume that userspace is also interested in the accumulated stats of its siblings? And if userspace _is_ interested in that info, it's still present in-kernel and can be queried for. > >Is there some better lock we can use in there? It only has to be > >threadgroup-wide rather than kernel-wide. > > > > > The lock we're holding is the tasklist_lock. To go through all the > threads of a thread group > thats the only lock that can protect integrity of while_each_thread afaics. At present, yes. That's persumably not impossible to fix. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- References:
- [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Balbir Singh <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- Prev by Date: Re: [linux-pm] swsusp regression [Was: 2.6.17-mm1]
- Next by Date: Re: Measuring tools - top and interrupts
- Previous by thread: Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- Next by thread: Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- Index(es):