Hi Andrew,
You asked: > > In other words: given that ELSA can do its thing via existing accounting > interfaces and a fork notifier, why does CSA need to add lots more kernel > code?
And i explained: > Here are some codes from do_exit() starting line 813 (based on > 2.6.11-rc4-mm1): > > 813 acct_update_integrals(tsk); > 814 update_mem_hiwater(tsk); > 815 group_dead = atomic_dec_and_test(&tsk->signal->live); > 816 if (group_dead) { > 817 del_timer_sync(&tsk->signal->real_timer); > 818 acct_process(code); > 819 } > 820 exit_mm(tsk); > > The acct_process() is called to save off BSD accounting data at > line 818. The next statement at 820, tsk->mm is disposed and all > data saved at tsk->mm is gone, including memory hiwater marks > information saved at line 814. The complete tsk is disposed > before exit of do_exit() routine.
I was hoping Guilluame could jump in himself... But, in a separate discussion thread, he wrote: >> (Jay asked) >> I spent some time trying to understand how ELSA save the per-process >> accounting data before the task_struct data structure gets disposed, >> but failed to find anything. My assumption would be that ELSA does >> not collection those data in the kernel itself? Instead, it would >> read the pacct file created by either BSD or CSA? > > Yes you're right, ELSA reads accounting file created by BSD or CSA. We > don't make accounting. I think that the communication problem is here
Guilluame's reply should answer your question. ELSA does not collect accounting data in the kernel as BSD/CSA does. It uses accounting data collected by BSD/CSA.
The exit hook is essential for CSA to save off data before the data is gone, A netlink type of thing does not help. BSD is in the same situation. You can not replace the acct_process() call with a netlink. If ELSA is to use the enhanced accounting data, it needs the CSA eop handling at exit as well.
Thanks, - jay
Guillaume Thouvenin wrote:
On Thu, 2005-02-24 at 20:46 -0800, Andrew Morton wrote:
Jay Lan <[EMAIL PROTECTED]> wrote:
Since my idea of providing an accounting framework was considered 'overkill', here i submit a tiny patch just to allow CSA to handle end-of-process (eop) situation by saving off accounting data before a task_struct is disposed.
This patch is to modify the acct_process() in acct.c, which is invoked from do_exit() to handle eop for BSD accounting. Now the acct_process() wrapper will also take care of CSA, if it has been loaded. If the CSA module has been loaded, a CSA routine will be invoked to construct a CSA job record and to write the record to the CSA accounting file.
I really don't want to have to (and shouldn't need to) become an accounting person, but as there seems to be a communication problem somewhere..
Please, you guys are the subject matter experts. Put your heads together and come up with something.
I completely agree with that and we will continue this conversation in private with Jay and all people involved to come up with an appropriate solution.
Guillaume
- 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/