• K
    [PATCH] pacct: none-delayed process accounting accumulation · 77787bfb
    KaiGai Kohei 提交于
    In current 2.6.17 implementation, signal_struct refered from task_struct is
    used for per-process data structure.  The pacct facility also uses it as a
    per-process data structure to store stime, utime, minflt, majflt.  But those
    members are saved in __exit_signal().  It's too late.
    
    For example, if some threads exits at same time, pacct facility has a
    possibility to drop accountings for a part of those threads.  (see, the
    following 'The results of original 2.6.17 kernel') I think accounting
    information should be completely collected into the per-process data structure
    before writing out an accounting record.
    
    This patch fixes this matter.  Accumulation of stime, utime, minflt and majflt
    are done before generating accounting record.
    
    [mingo@elte.hu: fix acct_collect() siglock bug found by lockdep]
    Signed-off-by: NKaiGai Kohei <kaigai@ak.jp.nec.com>
    Signed-off-by: NIngo Molnar <mingo@elte.hu>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    77787bfb
acct.c 16.6 KB