This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: analysis of polling in systemtap
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>, "Martin Hunt" <hunt at redhat dot com>
- Cc: <systemtap at sources dot redhat dot com>
- Date: Wed, 21 Dec 2005 11:57:52 -0800
- Subject: RE: analysis of polling in systemtap
Frank Ch. Eigler wrote:
> hunt wrote:
>> [...] The real problem I want to solve is how to better handle timer
>> events that print data and then clear a pmap. Because clearing a
>> large pmap can be expensive and could be done for free while
>> aggregating it.
>
> This idiom (iterating then clearing an array) may well be frequent
> enough to justify yet another addition to the "foreach" syntax, say a
> "delete" keyword somewhere in the mix. Before long, we'll get to the
> Common Lisp LOOP macro.
>
> - FChE
Perhaps it's the wrong approach to invent a new syntax for everything
that users might want to do atomically on an array. Can we instead
allow the user to explicitly lock/release variables?
This would give the user a lot of power over synchronization, but it
should still be safe. We already have dynamic deadlock detection, so
that's ok. It should be easy to add a dynamic check to make sure that
any locks acquired are released before the probe exits. (This may even
be possible to check statically, though much harder.) So the worst a
user could do with a buggy script is deadlock themselves and terminate;
the system remains unharmed.
We can still provide syntax to optimize some things, like the "aggregate
and clear" case that Martin describes, but it seems to me that we need a
more general functionality as well.
Josh