[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1891546521.01612153501819.JavaMail.epsvc@epcpadp3>
Date: Mon, 01 Feb 2021 12:51:36 +0900
From: Daejun Park <daejun7.park@...sung.com>
To: "James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
Bart Van Assche <bvanassche@....org>,
yongmyung lee <ymhungry.lee@...sung.com>,
Daejun Park <daejun7.park@...sung.com>,
ALIM AKHTAR <alim.akhtar@...sung.com>,
"asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
Zang Leigang <zangleigang@...ilicon.com>,
Avi Shchislowski <avi.shchislowski@....com>,
Bean Huo <beanhuo@...ron.com>,
"cang@...eaurora.org" <cang@...eaurora.org>,
"stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
Avri Altman <avri.altman@....com>
Subject: RE: [PATCH 3/8] scsi: ufshpb: Add region's reads counter
Hi Avri,
Thanks for adding HCM support on HPB.
I have some opinion for this patch.
> +#define WORK_PENDING 0
> +#define ACTIVATION_THRSHLD 4 /* 4 IOs */
Rather than fixing it with macro, how about using sysfs and make it
configurable?
> @@ -306,12 +325,39 @@ void ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> ufshpb_set_ppn_dirty(hpb, rgn_idx, srgn_idx, srgn_offset,
> transfer_len);
> spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> +
> + if (ufshpb_mode == HPB_HOST_CONTROL)
> + atomic64_set(&rgn->reads, 0);
> +
> return;
> }
>
> + if (ufshpb_mode == HPB_HOST_CONTROL)
> + reads = atomic64_inc_return(&rgn->reads);
> +
> if (!ufshpb_is_support_chunk(transfer_len))
> return; <- *this*
>
> + if (ufshpb_mode == HPB_HOST_CONTROL) {
> + /*
> + * in host control mode, reads are the main source for
> + * activation trials.
> + */
> + if (reads == ACTIVATION_THRSHLD) {
If the chunk size is not supported, we can not active this region
permanently. It may be returned before get this statement.
> diff --git a/drivers/scsi/ufs/ufshpb.h b/drivers/scsi/ufs/ufshpb.h
> index 8a34b0f42754..b0e78728af38 100644
> --- a/drivers/scsi/ufs/ufshpb.h
> +++ b/drivers/scsi/ufs/ufshpb.h
> @@ -115,6 +115,9 @@ struct ufshpb_region {
> /* below information is used by lru */
> struct list_head list_lru_rgn;
> unsigned long rgn_flags;
> +
> + /* region reads - for host mode */
> + atomic64_t reads;
I think 32 bits are suitable, because it is normalized by worker on every
specific time.
Thanks,
Daejun
Powered by blists - more mailing lists