]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ufs: ufshpb: Add reads counter
authorAvri Altman <avri.altman@wdc.com>
Mon, 12 Jul 2021 09:50:31 +0000 (12:50 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 1 Aug 2021 20:05:14 +0000 (16:05 -0400)
commit8dc4f43d608aedec7f75511767506800f0bd66c1
tree8a1841fb75bd37386c208adfc3c6ee17fb5bcb79
parent9b7794cb5998f813bf93b6161d27a4d33b91aba0
scsi: ufs: ufshpb: Add reads counter

In host control mode, reads are the major source of activation trials.
Keep track of those reads counters, for both active as well inactive
regions.

We reset the read counter upon write - we are only interested in "clean"
reads.

Keep those counters normalized, as we are using those reads as a
comparative score, to make various decisions.  If during consecutive
normalizations an active region has exhaust its reads - inactivate it.

While at it, protect the {active,inactive}_count stats by adding them into
the applicable handler.

Link: https://lore.kernel.org/r/20210712095039.8093-5-avri.altman@wdc.com
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshpb.c
drivers/scsi/ufs/ufshpb.h