Hello,

I am still trying to remove unused code to simplify perfmon so that others can
understand it better.

I have identified some code which is not really used and which does not add
much value.

As you know many perfmon sysem calls take vector arguments, e.g., 
pfm_write_pmds().
If one element in the vector is buggy, the system call fails. The interface
guarantees that all elements up to the faulty element are applied.
The current interface marks the faulty element such that it can be identified.
For pfm_write_pmds(), the reg_flags field is updated and may report EINVAL
or NOSET. The intent was to quickly identify the faulty element.

The downside of this is that the argument is modified and therefore there needs
to be a copy_to_user() on exit. This also makes it more difficult for tools 
when they
want to apply the same settings to multiple contexts in parallel, e.g., in 
system-wide.
the vectors need to be copied.

I am proposing that we drop the modified system call args for all vecotr 
arguments. The
only error message will be the return value of the syscall. It would be 
possible to
idnetify the faulty entry by trying with a shorter vector or using binaryt 
search if
necessary. In reality I think very few tools bother to understand to that level 
of 
details why a call fails.

The change will simplify the perfmon system calls and provide a performance 
boost
because the copy_to_user() will be removed.

Any comments?

-- 
-Stephane
_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to