mbox series

[v2,0/9] Add Host control mode to HPB

Message ID 20210202083007.104050-1-avri.altman@wdc.com
Headers show
Series Add Host control mode to HPB | expand

Message

Avri Altman Feb. 2, 2021, 8:29 a.m. UTC
v1 -> v2:
 - attend Greg's and Daejun's comments
 - add patch 9 making host mode parameters configurable
 - rebase on Daejun's v19


The HPB spec defines 2 control modes - device control mode and host
control mode. In oppose to device control mode, in which the host obey
to whatever recommendation received from the device - In host control
mode, the host uses its own algorithms to decide which regions should
be activated or inactivated.

We kept the host managed heuristic simple and concise.

Aside from adding a by-spec functionality, host control mode entails
some further potential benefits: makes the hpb logic transparent and
readable, while allow tuning / scaling its various parameters, and
utilize system-wide info to optimize HPB potential.

This series is based on Samsung's V19 device-control HPB1.0 driver, see
msg-id: 20210129052848epcms2p6e5797efd94e6282b76ad9ae6c99e3ab5@epcms2p6
in lore.kernel.org. The patches are also available in wdc ufs repo:
https://github.com/westerndigitalcorporation/WDC-UFS-REPO/tree/hpb-v19

This version was tested on Galaxy S20, and Xiaomi Mi10 pro.
Your meticulous review and testing is mostly welcome and appreciated.

Thanks,
Avri

Avri Altman (9):
  scsi: ufshpb: Cache HPB Control mode on init
  scsi: ufshpb: Add host control mode support to rsp_upiu
  scsi: ufshpb: Add region's reads counter
  scsi: ufshpb: Make eviction depends on region's reads
  scsi: ufshpb: Region inactivation in host mode
  scsi: ufshpb: Add hpb dev reset response
  scsi: ufshpb: Add "Cold" regions timer
  scsi: ufshpb: Add support for host control mode
  scsi: ufshpb: Make host mode parameters configurable

 drivers/scsi/ufs/ufshcd.c |   1 +
 drivers/scsi/ufs/ufshcd.h |   2 +
 drivers/scsi/ufs/ufshpb.c | 697 +++++++++++++++++++++++++++++++++++---
 drivers/scsi/ufs/ufshpb.h |  47 +++
 4 files changed, 697 insertions(+), 50 deletions(-)

Comments

Bean Huo Feb. 5, 2021, 11:36 a.m. UTC | #1
On Tue, 2021-02-02 at 10:29 +0200, Avri Altman wrote:
> v1 -> v2:

>  - attend Greg's and Daejun's comments

>  - add patch 9 making host mode parameters configurable

>  - rebase on Daejun's v19

> 

> 

> The HPB spec defines 2 control modes - device control mode and host

> control mode. In oppose to device control mode, in which the host

> obey

> to whatever recommendation received from the device - In host control

> mode, the host uses its own algorithms to decide which regions should

> be activated or inactivated.

> 

> We kept the host managed heuristic simple and concise.

> 

> Aside from adding a by-spec functionality, host control mode entails

> some further potential benefits: makes the hpb logic transparent and

> readable, while allow tuning / scaling its various parameters, and

> utilize system-wide info to optimize HPB potential.


Hi Avri
In addition to the above advantage of HPB device mode, would you please
share the performance comparison data with host mode? that will draw
more attention, since you mentioned "you tested on Galaxy S20, and
Xiaomi Mi10 pro", I think you have this kind of data.

Your HPB host driver sits in the ufs driver. Since my HPB host mode
driver is also implemented in the UFS driver layer, I did test my HPB
driver between device mode and host mode. Saw there is an improvement,
but not significant. If you can share your HPB drviver data, that will
be awesome.

Kind regards,
Bean
Bean Huo Feb. 5, 2021, 11:43 a.m. UTC | #2
On Fri, 2021-02-05 at 12:36 +0100, Bean Huo wrote:
> > to whatever recommendation received from the device - In host

> > control

> > mode, the host uses its own algorithms to decide which regions

> > should

> > be activated or inactivated.

> > 

> > We kept the host managed heuristic simple and concise.

> > 

> > Aside from adding a by-spec functionality, host control mode

> > entails

> > some further potential benefits: makes the hpb logic transparent

> > and

> > readable, while allow tuning / scaling its various parameters, and

> > utilize system-wide info to optimize HPB potential.

> 

> Hi Avri

> In addition to the above advantage of HPB device mode, would you

> please

> share the performance comparison data with host mode? that will draw

> more attention, since you mentioned "you tested on Galaxy S20, and

> Xiaomi Mi10 pro", I think you have this kind of data.

> 

> Your HPB host driver sits in the ufs driver. Since my HPB host mode

> driver is also implemented in the UFS driver layer, I did test my HPB

> driver between device mode and host mode. Saw there is an

> improvement,

> but not significant. If you can share your HPB drviver data, that

> will

> be awesome.

> 

> Kind regards,

> Bean


So sorry, there are several typos, easily confused you. correct them as
below:

Hi Avri

In addition to the above advantage of HPB "host control mode", would
you please share the performance comparison data with "device control
mode"? that will draw more attention, since you mentioned "you tested
on Galaxy S20, and Xiaomi Mi10 pro", I think you have this kind of
data.

Your HPB "host control mode" driver sits in the ufs driver. Since my
HPB "host control mode" driver is also implemented in the UFS driver
layer, I did test my HPB driver between device mode and host mode. Saw
UFS HPB "host control mode" driver has performance gain comparing to
HPB "device control mode" driver, but not significant. If you can share
your HPB host control mode drviver data, that will be awesome.

Kind regards,
Bean
Avri Altman Feb. 7, 2021, 2:07 p.m. UTC | #3
Hi Bean,
 
> In addition to the above advantage of HPB "host control mode", would

> you please share the performance comparison data with "device control

> mode"? that will draw more attention, since you mentioned "you tested

> on Galaxy S20, and Xiaomi Mi10 pro", I think you have this kind of

> data.

> 

> Your HPB "host control mode" driver sits in the ufs driver. Since my

> HPB "host control mode" driver is also implemented in the UFS driver

> layer, I did test my HPB driver between device mode and host mode. Saw

> UFS HPB "host control mode" driver has performance gain comparing to

> HPB "device control mode" driver, but not significant. If you can share

> your HPB host control mode drviver data, that will be awesome.

Host control mode wasn't standardized to overcome device mode performance.
Instead, host control mode, entails several advantages comparing to device control mode:
- Allow OEM vendors to have a unified HPB approach, with minor to null performance volatility across different storage vendors
- Flexible and transparent logic which doesn’t requires device firmware changes.
Hence, the discussion of host-control vs device control performance gain is chasing the red herring.

Thanks,
Avri