public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.11-rc4-mm1] end-of-proces handling for acct-csa
@ 2005-02-25  4:26 Jay Lan
  2005-02-25  4:46 ` Andrew Morton
  0 siblings, 1 reply; 11+ messages in thread
From: Jay Lan @ 2005-02-25  4:26 UTC (permalink / raw)
  To: LKML
  Cc: Andrew Morton, Guillaume Thouvenin, Tim Schmielau, Kaigai Kohei,
	Jesse Barnes

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

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.

This patch only touchs one file: kernel/acct.c.

Signed-off-by: Jay Lan <jlan@sgi.com>



[-- Attachment #2: acct-csa-eop --]
[-- Type: text/plain, Size: 938 bytes --]

Index: linux/kernel/acct.c
===================================================================
--- linux.orig/kernel/acct.c	2005-02-24 15:55:05.519092861 -0800
+++ linux/kernel/acct.c	2005-02-24 16:33:56.381584083 -0800
@@ -73,6 +73,11 @@ int acct_parm[3] = {4, 2, 30};
 /*
  * External references and all of the globals.
  */
+
+/* do_exit hook used by CSA */
+void (*do_exit_csa)(int, struct task_struct *) = NULL;
+EXPORT_SYMBOL_GPL(do_exit_csa);
+
 static void do_acct_process(long, struct file *);
 
 /*
@@ -504,12 +509,17 @@ static void do_acct_process(long exitcod
 }
 
 /*
- * acct_process - now just a wrapper around do_acct_process
+ * acct_process - now just a wrapper around
+ *	do_acct_process	- for BSD accounting
+ *	do_exit_csa	- for CSA
  */
 void acct_process(long exitcode)
 {
 	struct file *file = NULL;
 
+	if (do_exit_csa != NULL)
+		do_exit_csa(exitcode, current);
+
 	/*
 	 * accelerate the common fastpath:
 	 */

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-03-08  0:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-25  4:26 [PATCH 2.6.11-rc4-mm1] end-of-proces handling for acct-csa Jay Lan
2005-02-25  4:46 ` Andrew Morton
2005-02-25  6:57   ` Guillaume Thouvenin
2005-02-28 18:56     ` Jay Lan
2005-03-01  7:33       ` Guillaume Thouvenin
2005-03-01 18:06         ` Jay Lan
2005-03-02  7:48           ` Guillaume Thouvenin
2005-03-02 17:56             ` Jesse Barnes
2005-03-02 17:59             ` Jay Lan
2005-03-05  6:29             ` Tim Schmielau
2005-03-07 23:57               ` Jay Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox