[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Feb 2021 12:16:33 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Avri Altman <avri.altman@....com>
Cc: "James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
Bart Van Assche <bvanassche@....org>,
yongmyung lee <ymhungry.lee@...sung.com>,
Daejun Park <daejun7.park@...sung.com>,
alim.akhtar@...sung.com, asutoshd@...eaurora.org,
Zang Leigang <zangleigang@...ilicon.com>,
Avi Shchislowski <avi.shchislowski@....com>,
Bean Huo <beanhuo@...ron.com>, cang@...eaurora.org,
stanley.chu@...iatek.com
Subject: Re: [PATCH v2 3/9] scsi: ufshpb: Add region's reads counter
On Tue, Feb 02, 2021 at 10:30:01AM +0200, Avri Altman wrote:
> 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. less intuitive however, is that we also reset it upon region's
> deactivation. Region deactivation is often due to the fact that
> eviction took place: a region become active on the expense of another.
> This is happening when the max-active-regions limit has crossed. If we
> don’t reset the counter, we will trigger a lot of trashing of the HPB
> database, since few reads (or even one) to the region that was
> deactivated, will trigger a re-activation trial.
>
> 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.
>
> Signed-off-by: Avri Altman <avri.altman@....com>
> ---
> drivers/scsi/ufs/ufshpb.c | 109 ++++++++++++++++++++++++++++++++------
> drivers/scsi/ufs/ufshpb.h | 6 +++
> 2 files changed, 100 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
> index 61de80a778a7..de4866d42df0 100644
> --- a/drivers/scsi/ufs/ufshpb.c
> +++ b/drivers/scsi/ufs/ufshpb.c
> @@ -16,6 +16,9 @@
> #include "ufshpb.h"
> #include "../sd.h"
>
> +#define WORK_PENDING 0
This should be next to the variable you define that uses this, right?
Otherwise we would think this is a valid value, when in reality it is
the bit number, correct?
> +#define ACTIVATION_THRSHLD 4 /* 4 IOs */
You can spell things out "ACTIVATION_THRESHOLD" :)
thanks,
greg k-h
Powered by blists - more mailing lists