lkml.org 
[lkml]   [2005]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Process Events Connector
From
Date
On Fri, 2005-10-28 at 11:19 +0200, Arjan van de Ven wrote:
> On Fri, 2005-10-28 at 01:55 -0700, Matt Helsley wrote:
>
> > +void proc_fork_connector(struct task_struct *task)
> > +{
> > + struct cn_msg *msg;
> > + struct proc_event *ev;
> > + __u8 buffer[CN_PROC_MSG_SIZE];
>
> do you really want to do this stack based?

cn_netlink_send() performs an skb_alloc() and I wanted to avoid doing
two allocations that might sleep.

On a 32-bit machine the buffer should be around 42 bytes, making the
function locals around 50 bytes. On a 64-bit machine I believe this
should be around 58 bytes. Is this generally considered to be too large?

These functions are called from:

fork:

-> do_fork -> copy_process -> proc_fork_connector -> ...
-> fork_idle (this holds a struct ptregs) -> copy_process ->
proc_fork_connector -> ...

exec:

-> do_execve -> search_binary_handler -> proc_exec_connector -> ...

id:

-> sys_set(r|e|s|fs)?[ug]id -> proc_id_connector -> ...

exit:

-> do_exit -> proc_exit_connector -> ...

Where "-> ..." signifies a call to cn_netlink_send(). So they should
only be a problem if a caller or cn_netlink_send() use too much stack
space.

Cheers,
-Matt Helsley
< matthltc @ us.ibm.com >

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-28 12:23    [W:1.619 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site