From: Christoph Hellwig <hch@infradead.org>
To: Guillaume Thouvenin <Guillaume.Thouvenin@Bull.net>
Cc: lkml <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 2.6.9] fork: add a hook in do_fork()
Date: Tue, 23 Nov 2004 09:03:25 +0000 [thread overview]
Message-ID: <20041123090325.GA22114@infradead.org> (raw)
In-Reply-To: <1101189797.6210.53.camel@frecb000711.frec.bull.fr>
On Tue, Nov 23, 2004 at 07:03:17AM +0100, Guillaume Thouvenin wrote:
> Hello,
>
> For a module, I need to execute a function when a fork occurs. My
> solution is to add a pointer to a function (called fork_hook) in the
> do_fork() and if this pointer isn't NULL, I call the function. To update
> the pointer to the function I export a symbol (called trace_fork) that
> defines another function with two parameters (the hook and an
> identifier). This function provides a simple mechanism to manage access
> to the fork_hook variable.
>
> I don't know if this solution is good but it's easy to implement and
> it just does the trick. I made some tests and it doesn't impact the
> performance of the Linux kernel.
>
> I'd like to have your comment about this patch. Is it useful and is
> it needed by someone else than me?
Use SGI's PAGG patches if you want such hooks. Also this is clearly
a _GPL export.
next prev parent reply other threads:[~2004-11-23 9:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-23 6:03 [PATCH 2.6.9] fork: add a hook in do_fork() Guillaume Thouvenin
2004-11-23 8:06 ` Greg KH
2004-11-23 8:56 ` Guillaume Thouvenin
2004-11-23 10:09 ` Guillaume Thouvenin
2004-11-23 14:14 ` Guillaume Thouvenin
2004-11-23 21:51 ` Chris Wright
2004-11-24 8:14 ` Guillaume Thouvenin
2004-11-23 9:03 ` Christoph Hellwig [this message]
2004-11-23 9:33 ` Guillaume Thouvenin
2004-11-23 19:31 ` Jay Lan
2004-11-23 9:59 ` Hua Zhong
2004-11-23 10:14 ` Guillaume Thouvenin
2004-11-23 13:55 ` Jan Engelhardt
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=20041123090325.GA22114@infradead.org \
--to=hch@infradead.org \
--cc=Guillaume.Thouvenin@Bull.net \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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