On Tue, Jul 17, 2018 at 8:01 AM Per F?rlin <per.forlin at axis.com> wrote: > > Thanks Richard for your feedback, > > > ________________________________________ > > From: Richard Weinberger <richard at nod.at> > > Sent: Tuesday, July 17, 2018 4:34 PM > > To: Per F?rlin > > Cc: linux-mtd at lists.infradead.org; Artem Bityutskiy > > Subject: Re: [PATCH] UBI: Add volume read and write statistics > > > > Per, > > > > Am Dienstag, 17. Juli 2018, 14:08:51 CEST schrieb Per F?rlin: > > > > To: Per F?rlin > > > > Cc: linux-mtd at lists.infradead.org; Artem Bityutskiy; Per F?rlin > > > > Subject: Re: [PATCH] UBI: Add volume read and write statistics > > > > > > > > Am Dienstag, 17. Juli 2018, 12:30:19 CEST schrieb Per Forlin: > > > > > Simple read and write statistics. > > > > > * Bytes read > > > > > * Bytes written > > > > > * Number of reads > > > > > * Number of writes > > > > > > > > > > This is useful to find out how the storage is being utilized. > > > > > For block devices this already exists via /proc/diskstats. > > > > > The intention of this patch is to add similar stats > > > > > for UBI as well. > > > > > > > > Why on UBI level and not MTD? > > > In my case I wanted to evaluate the performance per volume. I have one MTD > > > device with several UBI volumes. It would be sufficient to have it on > > > an MTD level to see the overall storage usage. > > > This would still be very helpful for me. > > > > > > Having it on an MTD level is of course more general. > > > I wouldn't mind changing the patch to add the stats in mtdcore > > > for mtd_read() and mtd_write() > > > > > > In case of MTD block devices the stats will be somewhat redundant with > > > /proc/diskstats. > > > > > > Do you think I should update the patch to add MTD stats instead? > > > > While having a cup of coffee I thought more about this. > > Actually both, MTD and UBI makes sense. > > The most important issue is that you integrate it with the existing diskstats. > > So instead of having our own interface feeding MTD/UBI stats into diskstats > > would be nice. Did you look into that? I'm not sure how much work this would be. > > That way users can use existing tools such as iostat... > I actually started out looking for the information under diskstats, > then I learned it's only for block devices. I took a quick glance at > it before I went for the sys implementation instead. diskstats is > separated from the MTD and UBI stuff and I don't know if one can make a > connection to MTD/UBI somehow. I will take a closer look at this. Perhaps it was "only for block devices" because no one ever implemented the necessary hooks in MTD or UBI? I don't know the history, nor the information you found, just making a stab in the dark. If UBI and/or MTD can provide the statistics that diskstats needs in a interpretation that makes sense, why not go that way? - Steve