Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats

Jay Lan
2006-06-21T23:35:37Z

>>> System: SGI a350, a two cpus IA64 machine.
>>> Kernel: 2.6.17-rc3 + delay-acct-taskstats patch set
>>> + tgid-disable_patch_shailabh + exit race patch_balbir +
>>> csa_patch_jlan
>>>
>>> I also modified the Decumentation/accounting/getdelay.c:
>>> - it repeatedly does recv() to retrieve data from kernel
>>> - instead of using printf() to display data received, i simply write
>>> it to
>>> disk as it would be for an accounting daemon. Note that currently
>>> both the
>>> BSD (or GNU) accounting and the CSA writes accounting data from
>>> kernel.
>>> As an effort of moving accounting system to userspace, the raw data
>>> needs
>>> to be written to a raw file first before further processing.
>>>
> In exit_recv.c, you appear to be dumping the per-tgid data received
> to disk too ?
> If the accounting daemon isn't interested in per-tgid, shouldn't it be
> discarding the data immediately after
> doing the recv() and only write to disk the data it wants ?
> Perhaps I'm missing something.
>
I modified my exit_recv.c so that
1) i can totally skip data marked TASKSTATS_TYPE_AGGR_TGID
2) i can optinally drop data after receipt without writing to disk

The first case produced a system time of 1.34 second and the second
case produced a system time of 1.25 sec. Big improvement over 1.74
sec, but still too high compared to 0.34 sec when we disable tgid
completely.

Shailabh and me now eye on the lock patch that fixed an exit race
crash i reported. The global lock was held too long in scanning threads.
Shailabh is working on a new patch.

- jay