On Thu, Mar 08, 2012 at 11:48:53AM +0100, Lukas Czerner wrote: [..] > > > In my mind the only thing we can reliably measure is the I/O we're > > > transmitting to or receiving from the device. So I'd personally like to > > > see zero for discard and logical block size for write same. > > > > counting IO which is being transmitted/received from device makes > > sense (Given the fact we don't know how much actual work device will > > have to do). So counting 1 block for write same and zero block for discard > > sounds reasonable to me. > > > > Looks like current code counts all the discard sectors towards number of > > blocks written. So that will need to be changed. CCing Lukas, he might have > > thoughts/opinion on discard request accounting. > > I am little surprised that we still count all the discard sectors > towards the number of bock written. I have mentioned this problem to > Jens last year. > > Anyway, it would be nice to have separate counter for discard requests > and actually counting the discard sectors rather than just one for each > discard bio. I know that the device can ignore the whole, or part of the > request for its own reasons. But it is not a reason for not counting > what we actually intended to discard. I think this statistic will be > useful. > > Consider for example the situation where you find you that you're > constantly discarding more than you actually write to the device over > some period of time. The you would probably want to adjust your discard > policy. Yes, may be recording number of discards is not a bad idea. Currently we record following for disk stats. struct disk_stats { unsigned long sectors[2]; /* READs and WRITEs */ unsigned long ios[2]; unsigned long merges[2]; unsigned long ticks[2]; unsigned long io_ticks; unsigned long time_in_queue; }; May be it can be extended to record number of discards completed and user space tools (iostat) modified to extract this info. But that seems to be a separate functionality. So we can drop counting discard sectors towards write? Anyway, as of today you can't extract this info how many writes you did and how many of these were discards. So as such there is no regression in terms of features? Thanks Vivek -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html