Messages in this thread | | | Subject | Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats | From | jamal <> | Date | Tue, 04 Jul 2006 15:24:30 -0400 |
| |
Shailabh,
On Tue, 2006-04-07 at 12:37 -0400, Shailabh Nagar wrote: [..] > Here's a strawman for the problem we're trying to solve: get > notification of the close of a NETLINK_GENERIC socket that had > been used to register interest for some cpus within taskstats. > > From looking at the netlink code, the way to go seems to be > > - it maintains a pidhash of nl_pids that are currently > registered to listen to atleast one cpu. It also stores the > cpumask used. > - taskstats registers a notifier block within netlink_chain > and receives a callback on the NETLINK_URELEASE event, similar > to drivers/scsci/scsi_transport_iscsi.c: iscsi_rcv_nl_event() > > - the callback checks to see that the protocol is NETLINK_GENERIC > and that the nl_pid for the socket is in taskstat's pidhash. If so, it > does a cleanup using the stored cpumask and releases the nl_pid > from the pidhash. >
Sound quiet reasonable. I am beginning to wonder whether we should do do the NETLINK_URELEASE in general for NETLINK_GENERIC
> We can even do away with the deregister command altogether and > simply rely on this autocleanup.
I think if you may still need the register if you are going to allow multiple sockets per listener process, no? The other question is how do you correlate pid -> fd?
cheers, jamal
- 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/
| |