From: Matt Helsley <matthltc@us.ibm.com>
To: Chase Venters <chase.venters@clientec.com>
Cc: Andrew Morton <akpm@osdl.org>,
Linux-Kernel <linux-kernel@vger.kernel.org>,
Jes Sorensen <jes@sgi.com>,
LSE-Tech <lse-tech@lists.sourceforge.net>,
Chandra S Seetharaman <sekharan@us.ibm.com>,
Alan Stern <stern@rowland.harvard.edu>,
John T Kohl <jtk@us.ibm.com>, Balbir Singh <balbir@in.ibm.com>,
Shailabh Nagar <nagar@watson.ibm.com>,
Guillaume Thouvenin <guillaume.thouvenin@bull.net>
Subject: Re: [PATCH 02/11] Task watchers: Register process events task watcher
Date: Tue, 13 Jun 2006 17:52:37 -0700 [thread overview]
Message-ID: <1150246357.21787.187.camel@stark> (raw)
In-Reply-To: <200606131940.00539.chase.venters@clientec.com>
On Tue, 2006-06-13 at 19:39 -0500, Chase Venters wrote:
> On Tuesday 13 June 2006 18:54, Matt Helsley wrote:
>
> > +static int cn_proc_watch_task(struct notifier_block *nb, unsigned long
> > val, + void *t)
> > +{
> > + struct task_struct *task = t;
>
> Why the copy?
It shouldn't result in a copy. Since t is a void* I don't think any
additional instructions or stack space are required. This should have
zero runtime cost while improving clarity of the code. It's also needed
in the next patch.
> > + int rc = NOTIFY_OK;
> > +
> > + switch (get_watch_event(val)) {
> > + case WATCH_TASK_CLONE:
> > + proc_fork_connector(task);
> > + break;
> > + case WATCH_TASK_EXEC:
> > + proc_exec_connector(task);
> > + break;
> > + case WATCH_TASK_UID:
> > + proc_id_connector(task, PROC_EVENT_UID);
> > + break;
> > + case WATCH_TASK_GID:
> > + proc_id_connector(task, PROC_EVENT_GID);
> > + break;
> > + case WATCH_TASK_EXIT:
> > + proc_exit_connector(task);
> > + break;
> > + default: /* we don't care about WATCH_TASK_INIT|FREE because we
> > + don't keep per-task info */
> > + rc = NOTIFY_DONE; /* ignore all other notifications */
> > + break;
> > + }
> > + return rc;
> > +}
> > +
>
> > /*
> > * cn_proc_init - initialization entry point
> > *
> > * Adds the connector callback to the connector driver.
> > */
> > @@ -219,11 +259,16 @@ static int __init cn_proc_init(void)
> > int err;
> >
> > if ((err = cn_add_callback(&cn_proc_event_id, "cn_proc",
> > &cn_proc_mcast_ctl))) {
> > printk(KERN_WARNING "cn_proc failed to register\n");
> > - return err;
> > + goto out;
> > }
> > - return 0;
> > +
> > + err = register_task_watcher(&cn_proc_nb);
> > + if (err != 0)
>
> if (err)
I don't see any benefit to changing this. Care to elaborate on why this
is important?
> Thanks,
> Chase
next prev parent reply other threads:[~2006-06-14 1:00 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060613235122.130021000@localhost.localdomain>
2006-06-13 23:53 ` [PATCH 01/11] Task watchers: Task Watchers Matt Helsley
2006-06-14 0:19 ` Chase Venters
2006-06-14 0:55 ` Matt Helsley
2006-06-13 23:54 ` [PATCH 02/11] Task watchers: Register process events task watcher Matt Helsley
2006-06-14 0:39 ` Chase Venters
2006-06-14 0:52 ` Matt Helsley [this message]
2006-06-13 23:54 ` [PATCH 03/11] Task watchers: Refactor process events Matt Helsley
2006-06-14 0:43 ` Chase Venters
2006-06-14 1:11 ` Matt Helsley
2006-06-14 8:09 ` Chase Venters
2006-06-13 23:54 ` [PATCH 04/11] Task watchers: Make process events configurable as a module Matt Helsley
2006-06-14 0:54 ` Chase Venters
2006-06-14 1:18 ` [Lse-tech] " Matt Helsley
2006-06-13 23:54 ` [PATCH 05/11] Task watchers: Allow task watchers to block Matt Helsley
2006-06-13 23:54 ` [PATCH 06/11] Task watchers: Register audit task watcher Matt Helsley
2006-06-14 14:46 ` Alexander Viro
2006-06-14 23:28 ` Matt Helsley
2006-06-13 23:54 ` [PATCH 07/11] Task watchers: Register per-task delay accounting " Matt Helsley
2006-06-14 3:31 ` Shailabh Nagar
2006-06-14 22:52 ` Matt Helsley
2006-06-13 23:54 ` [PATCH 08/11] Task watchers: Register profile as a " Matt Helsley
2006-06-14 0:59 ` Chase Venters
2006-06-14 1:16 ` [Lse-tech] " Matt Helsley
2006-06-13 23:55 ` [PATCH 09/11] Task watchers: Add support for per-task watchers Matt Helsley
2006-06-20 5:28 ` Peter Williams
2006-06-20 22:56 ` [Lse-tech] " Matt Helsley
2006-06-20 23:15 ` Andrew Morton
2006-06-20 23:23 ` Peter Williams
2006-06-21 1:20 ` Matt Helsley
2006-06-21 1:46 ` Andrew Morton
2006-06-21 1:55 ` Peter Williams
2006-06-21 13:01 ` Peter Williams
2006-06-21 13:23 ` Peter Williams
2006-06-21 2:28 ` Matt Helsley
2006-06-20 23:21 ` Peter Williams
2006-06-13 23:55 ` [PATCH 10/11] Task watchers: Register semundo task watcher Matt Helsley
2006-06-13 23:55 ` [PATCH 11/11] Task watchers: Register per-task semundo watcher Matt Helsley
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=1150246357.21787.187.camel@stark \
--to=matthltc@us.ibm.com \
--cc=akpm@osdl.org \
--cc=balbir@in.ibm.com \
--cc=chase.venters@clientec.com \
--cc=guillaume.thouvenin@bull.net \
--cc=jes@sgi.com \
--cc=jtk@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=nagar@watson.ibm.com \
--cc=sekharan@us.ibm.com \
--cc=stern@rowland.harvard.edu \
/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