RE: [patch 6/6] statistics infrastructure - exploitation: zfcp

James.Smart
2005-12-15T15:28:08Z

This patch is right along the lines of what we did with this earlier patch
http://marc.theaimsgroup.com/?l=linux-scsi&m=110700743207792&w=2
which adds, at the sdev level, counters for # of requests performed,
# of requests completed, # of requests completed in error.

of all the stats you propose:
>>+ struct statistic *stat_sizes_scsi_write;
>>+ struct statistic *stat_sizes_scsi_read;
>>+ struct statistic *stat_sizes_scsi_nodata;
>>+ struct statistic *stat_sizes_scsi_nofit;
>>+ struct statistic *stat_sizes_scsi_nomem;
>>+ struct statistic *stat_sizes_timedout_write;
>>+ struct statistic *stat_sizes_timedout_read;
>>+ struct statistic *stat_sizes_timedout_nodata;
>>+ struct statistic *stat_latencies_scsi_write;
>>+ struct statistic *stat_latencies_scsi_read;
>>+ struct statistic *stat_latencies_scsi_nodata;
>>+ struct statistic *stat_pending_scsi_write;
>>+ struct statistic *stat_pending_scsi_read;
>>+ struct statistic *stat_erp;
>>+ struct statistic *stat_eh_reset;

All of these are best served to be managed by the midlayer at the
sdev. Please don't make the LLDDs do the incrementing, etc - or something
that is owned by one layer, modified by another, and bounces back and forth.
The only question is the latency fields, as your statement on latency is a
good one. IMHO, the latency that matters is the latency the midlayer sees
when it calls queuecommand. The LLDD interface is designed to not queue in
the LLDD's, and you really can't peek lower than the LLDD to know when the
i/o actually hits the wire. So - just measure at the queuecommand/scsidone level
(or up in the block request queue level).

And, if we are expanding stats from the earlier 3 things, we ought to follow
the framework the fc transport used for stats (stolen from the network world)
and create a subdirectory under the /sys/block/<>/ object that reports
the stats.

-- james s