This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC] [PATCH] tapset to count number open file handlers and max file handlers for a process
Hi -
On Thu, Aug 30, 2007 at 07:27:47PM +0530, Srinivasa Ds wrote:
> [...]
> > There is at least one problem: all the pointer dereferences are
> > unprotected. Please use kread() for every link in the pointer chain,
> > in anticipation that every pointer might be corrupt.
>
> Done
Thanks, but not quite: *every link* needs to be protected. For
example, this expression has three, so you'll need temporary variables
or more nesting/casting:
> THIS->__retvalue = kread(&(t->files->fdt->max_fds));
> [...] I have used rcu_read_lock(), thinking it will not harm the
> code (Please correct me if Iam wrong).
Yeah, I think that will work.
> We can even consider putting comment, if we have problem with the
> locks.
That's the wrong way around - we should err on the side of adding
comments if we even speculate about a potential problem.
> > Finally, for a real check-in, one would need documentation in stapfuncs
> > and at least a buildok item in the test suite.
>
> I am ready to work on this.
Great.
- FChE