From: Jay Lan <jlan@sgi.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>,
Guillaume Thouvenin <guillaume.thouvenin@bull.net>,
Tim Schmielau <tim@physik3.uni-rostock.de>,
Kaigai Kohei <kaigai@ak.jp.nec.com>,
Jesse Barnes <jbarnes@sgi.com>
Subject: [PATCH 2.6.11-rc4-mm1] end-of-proces handling for acct-csa
Date: Thu, 24 Feb 2005 20:26:39 -0800 [thread overview]
Message-ID: <421EA8FF.1050906@sgi.com> (raw)
[-- 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:
*/
next reply other threads:[~2005-02-25 4:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-25 4:26 Jay Lan [this message]
2005-02-25 4:46 ` [PATCH 2.6.11-rc4-mm1] end-of-proces handling for acct-csa 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=421EA8FF.1050906@sgi.com \
--to=jlan@sgi.com \
--cc=akpm@osdl.org \
--cc=guillaume.thouvenin@bull.net \
--cc=jbarnes@sgi.com \
--cc=kaigai@ak.jp.nec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tim@physik3.uni-rostock.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox