From: Greg KH <gregkh@linuxfoundation.org>
To: Avri Altman <avri.altman@wdc.com>
Cc: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Bart Van Assche <bvanassche@acm.org>,
yongmyung lee <ymhungry.lee@samsung.com>,
Daejun Park <daejun7.park@samsung.com>,
alim.akhtar@samsung.com, asutoshd@codeaurora.org,
Zang Leigang <zangleigang@hisilicon.com>,
Avi Shchislowski <avi.shchislowski@wdc.com>,
Bean Huo <beanhuo@micron.com>,
cang@codeaurora.org, stanley.chu@mediatek.com
Subject: Re: [PATCH v3 9/9] scsi: ufshpb: Make host mode parameters configurable
Date: Thu, 18 Feb 2021 14:48:34 +0100 [thread overview]
Message-ID: <YC5wMu6Axu8G+Nsg@kroah.com> (raw)
In-Reply-To: <20210218131932.106997-10-avri.altman@wdc.com>
On Thu, Feb 18, 2021 at 03:19:32PM +0200, Avri Altman wrote:
> We can make use of this commit, to elaborate some more of the host
> control mode logic, explaining what role play each and every variable.
>
> While at it, allow those parameters to be configurable.
>
> Signed-off-by: Avri Altman <avri.altman@wdc.com>
> ---
> Documentation/ABI/testing/sysfs-driver-ufs | 68 ++++++
> drivers/scsi/ufs/ufshpb.c | 254 +++++++++++++++++++--
> drivers/scsi/ufs/ufshpb.h | 18 ++
> 3 files changed, 326 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-ufs b/Documentation/ABI/testing/sysfs-driver-ufs
> index 0017eaf89cbe..1d72201c4953 100644
> --- a/Documentation/ABI/testing/sysfs-driver-ufs
> +++ b/Documentation/ABI/testing/sysfs-driver-ufs
> @@ -1322,3 +1322,71 @@ Description: This entry shows the maximum HPB data size for using single HPB
> === ========
>
> The file is read only.
> +
> +What: /sys/class/scsi_device/*/device/hpb_param_sysfs/activation_thld
> +Date: February 2021
> +Contact: Avri Altman <avri.altman@wdc.com>
> +Description: In host control mode, reads are the major source of activation
> + trials. once this threshold hs met, the region is added to the
> + "to-be-activated" list. Since we reset the read counter upon
> + write, this include sending a rb command updating the region
> + ppn as well.
> +
> +What: /sys/class/scsi_device/*/device/hpb_param_sysfs/normalization_factor
> +Date: February 2021
> +Contact: Avri Altman <avri.altman@wdc.com>
> +Description: In host control mode, We think of the regions as "buckets".
> + Those buckets are being filled with reads, and emptied on write.
> + We use entries_per_srgn - the amount of blocks in a subregion as
> + our bucket size. This applies because HPB1.0 only concern a
> + single-block reads. Once the bucket size is crossed, we trigger
> + a normalization work - not only to avoid overflow, but mainly
> + because we want to keep those counters normalized, as we are
> + using those reads as a comparative score, to make various decisions.
> + The normalization is dividing (shift right) the read counter by
> + the normalization_factor. If during consecutive normalizations
> + an active region has exhaust its reads - inactivate it.
> +
> +What: /sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_enter
> +Date: February 2021
> +Contact: Avri Altman <avri.altman@wdc.com>
> +Description: 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.
> + In host mode, eviction is considered an extreme measure. We
> + want to verify that the entering region has enough reads, and
> + the exiting region has much less reads. eviction_thld_enter is
> + the min reads that a region must have in order to be considered
> + as a candidate to evict other region.
> +
> +What: /sys/class/scsi_device/*/device/hpb_param_sysfs/eviction_thld_exit
> +Date: February 2021
> +Contact: Avri Altman <avri.altman@wdc.com>
> +Description: same as above for the exiting region. A region is consider to
> + be a candidate to be evicted, only if it has less reads than
> + eviction_thld_exit.
> +
> +What: /sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_ms
> +Date: February 2021
> +Contact: Avri Altman <avri.altman@wdc.com>
> +Description: In order not to hang on to “cold” regions, we shall inactivate
> + a region that has no READ access for a predefined amount of
> + time - read_timeout_ms. If read_timeout_ms has expired, and the
> + region is dirty - it is less likely that we can make any use of
> + HPB-READing it. So we inactivate it. Still, deactivation has
> + its overhead, and we may still benefit from HPB-READing this
> + region if it is clean - see read_timeout_expiries.
> +
> +What: /sys/class/scsi_device/*/device/hpb_param_sysfs/read_timeout_expiries
> +Date: February 2021
> +Contact: Avri Altman <avri.altman@wdc.com>
> +Description: if the region read timeout has expired, but the region is clean,
> + just re-wind its timer for another spin. Do that as long as it
> + is clean and did not exhaust its read_timeout_expiries threshold.
> +
> +What: /sys/class/scsi_device/*/device/hpb_param_sysfs/timeout_polling_interval_ms
> +Date: February 2021
> +Contact: Avri Altman <avri.altman@wdc.com>
> +Description: the frequency in which the delayed worker that checks the
> + read_timeouts is awaken.
> +>>>>>>> ef6bf08e666d... scsi: ufshpb: Make host mode parameters configurable
Did you mean for this last line to be here?
next prev parent reply other threads:[~2021-02-18 16:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-18 13:19 [PATCH v3 0/9] Add Host control mode to HPB Avri Altman
2021-02-18 13:19 ` [PATCH v3 1/9] scsi: ufshpb: Cache HPB Control mode on init Avri Altman
2021-02-18 13:19 ` [PATCH v3 2/9] scsi: ufshpb: Add host control mode support to rsp_upiu Avri Altman
2021-02-18 13:19 ` [PATCH v3 3/9] scsi: ufshpb: Add region's reads counter Avri Altman
2021-02-18 13:19 ` [PATCH v3 4/9] scsi: ufshpb: Make eviction depends on region's reads Avri Altman
2021-02-18 13:19 ` [PATCH v3 5/9] scsi: ufshpb: Region inactivation in host mode Avri Altman
2021-02-18 13:19 ` [PATCH v3 6/9] scsi: ufshpb: Add hpb dev reset response Avri Altman
2021-02-18 13:19 ` [PATCH v3 7/9] scsi: ufshpb: Add "Cold" regions timer Avri Altman
2021-02-18 13:19 ` [PATCH v3 8/9] scsi: ufshpb: Add support for host control mode Avri Altman
2021-02-18 13:19 ` [PATCH v3 9/9] scsi: ufshpb: Make host mode parameters configurable Avri Altman
2021-02-18 13:48 ` Greg KH [this message]
2021-02-18 14:09 ` Avri Altman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YC5wMu6Axu8G+Nsg@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=avi.shchislowski@wdc.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=daejun7.park@samsung.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stanley.chu@mediatek.com \
--cc=ymhungry.lee@samsung.com \
--cc=zangleigang@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).