linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 00/13] scsi: ufs: Add HPB Support
@ 2020-05-15 10:30 Avri Altman
  2020-05-15 10:30 ` [RFC PATCH 01/13] scsi: ufs: Add HPB parameters Avri Altman
                   ` (13 more replies)
  0 siblings, 14 replies; 39+ messages in thread
From: Avri Altman @ 2020-05-15 10:30 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, linux-scsi, linux-kernel
  Cc: Bart Van Assche, alim.akhtar, asutoshd, Zang Leigang,
	Avi Shchislowski, Bean Huo, cang, stanley.chu,
	MOHAMMED RAFIQ KAMAL BASHA, Sang-yoon Oh, yongmyung lee,
	Jinyoung CHOI, Avri Altman

NAND flash-based storage devices, needs to translate the logical
addresses of the IO requests to its corresponding physical addresses of
the flash storage.  As the internal SRAM of the storage device cannot
accommodate the entire L2P mapping table, the device can only partially
load the L2P data it needs based on the incoming LBAs. As a result,
cache misses - which are more frequent in random read access, can result
in serious performance degradation.  To remedy the above, UFS3.1 offers
the Host Performance Booster (HPB) feature, which uses the host’s system
memory as a cache for L2P map data. The basic concept of HPB is to
cache L2P mapping entries in host system memory so that both physical
block address (PBA) and logical block address (LBA) can be delivered in
HPB read command.  Not to be confused with host-managed-FTL, HPB is
merely about NAND flash cost reduction.

HPB, by its nature, imposes an interesting question regarding the proper
location of its components across the storage stack. On Init it requires
to detect the HPB capabilities and parameters, which can be only done
from the LLD level.  On the other hand, it requires to send scsi
commands as part of its cache management, which preferably should be
done from scsi mid-layer,  and compose the "HPB_READ" command, which
should be done as part of scsi command setup path.
Therefore, we came up with a 2 module layout: ufshpb in the ufs driver,
and scsi_dh_ufshpb under scsi device handler.

The ufshpb module bear 2 main duties. During initialization, it reads
the hpb configuration from the device. Later on, during the scan host
phase, it attaches the scsi device and activates the scsi hpb device
handler.  The second duty mainly concern supporting the HPB cache
management. The scsi hpb device handler will perform the cache
management and send the HPB_READ command. The modules will communicate
via the standard device handler API: the handler_data opaque pointer,
and the set_params op-mode.

This series has borrowed heavily from a HPB implementation that was
published as part of the pixel3 code, authored by:
Yongmyung Lee <ymhungry.lee@samsung.com> and
Jinyoung Choi <j-young.choi@samsung.com>.

We kept some of its design and implementation details. We made some
minor modifications to adopt the latest spec changes (HPB1.0 was not
close when the driver initially published), and also divide the
implementation between the scsi handler and the ufs modules, instead of
a single module in the original driver, which simplified the
implementation to a great deal and resulted in far less code. One more
big difference is that the Pixel3 driver support device managed mode,
while we are supporting host managed mode, which reflect heavily on the
cache management decision process.

Many thanks to Damien Le Moal for his insightful comments.


Avri Altman (13):
  scsi: ufs: Add HPB parameters
  scsi: ufshpb: Init part I - Read HPB config
  scsi: scsi_dh: Introduce scsi_dh_ufshpb
  scsi: ufs: ufshpb: Init part II - Attach scsi device
  scsi: ufs: ufshpb: Disable HPB if no HPB-enabled luns
  scsi: scsi_dh: ufshpb: Prepare for L2P cache management
  scsi: scsi_dh: ufshpb: Add ufshpb state machine
  scsi: dh: ufshpb: Activate pinned regions
  scsi: ufshpb: Add response API
  scsi: dh: ufshpb: Add ufshpb_set_params
  scsi: Allow device handler set their own CDB
  scsi: dh: ufshpb: Add prep_fn handler
  scsi: scsi_dh: ufshpb: Add "Cold" subregions timer

 drivers/scsi/device_handler/Makefile         |    1 +
 drivers/scsi/device_handler/scsi_dh_ufshpb.c | 1480 ++++++++++++++++++++++++++
 drivers/scsi/scsi_lib.c                      |    5 +-
 drivers/scsi/sd.c                            |    9 +
 drivers/scsi/ufs/Kconfig                     |   13 +
 drivers/scsi/ufs/Makefile                    |    1 +
 drivers/scsi/ufs/ufs.h                       |   16 +
 drivers/scsi/ufs/ufshcd.c                    |   12 +
 drivers/scsi/ufs/ufshcd.h                    |   11 +
 drivers/scsi/ufs/ufshpb.c                    |  610 +++++++++++
 drivers/scsi/ufs/ufshpb.h                    |   28 +
 include/scsi/scsi_dh_ufshpb.h                |   67 ++
 12 files changed, 2251 insertions(+), 2 deletions(-)
 create mode 100644 drivers/scsi/device_handler/scsi_dh_ufshpb.c
 create mode 100644 drivers/scsi/ufs/ufshpb.c
 create mode 100644 drivers/scsi/ufs/ufshpb.h
 create mode 100644 include/scsi/scsi_dh_ufshpb.h

-- 
2.7.4


^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2020-05-27 11:47 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 10:30 [RFC PATCH 00/13] scsi: ufs: Add HPB Support Avri Altman
2020-05-15 10:30 ` [RFC PATCH 01/13] scsi: ufs: Add HPB parameters Avri Altman
2020-05-15 10:30 ` [RFC PATCH 02/13] scsi: ufshpb: Init part I - Read HPB config Avri Altman
2020-05-15 15:33   ` Randy Dunlap
2020-05-16  1:46   ` Bart Van Assche
2020-05-16  1:57   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 03/13] scsi: scsi_dh: Introduce scsi_dh_ufshpb Avri Altman
2020-05-16  1:48   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 04/13] scsi: ufs: ufshpb: Init part II - Attach scsi device Avri Altman
2020-05-16  1:52   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 05/13] scsi: ufs: ufshpb: Disable HPB if no HPB-enabled luns Avri Altman
2020-05-16  2:02   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 06/13] scsi: scsi_dh: ufshpb: Prepare for L2P cache management Avri Altman
2020-05-16  2:13   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 07/13] scsi: scsi_dh: ufshpb: Add ufshpb state machine Avri Altman
2020-05-16  2:44   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 08/13] scsi: dh: ufshpb: Activate pinned regions Avri Altman
2020-05-15 10:30 ` [RFC PATCH 09/13] scsi: ufshpb: Add response API Avri Altman
2020-05-16  3:06   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 10/13] scsi: dh: ufshpb: Add ufshpb_set_params Avri Altman
2020-05-15 10:30 ` [RFC PATCH 11/13] scsi: Allow device handler set their own CDB Avri Altman
2020-05-16  3:19   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 12/13] scsi: dh: ufshpb: Add prep_fn handler Avri Altman
2020-05-16  3:40   ` Bart Van Assche
2020-05-15 10:30 ` [RFC PATCH 13/13] scsi: scsi_dh: ufshpb: Add "Cold" subregions timer Avri Altman
2020-05-16  3:50 ` [RFC PATCH 00/13] scsi: ufs: Add HPB Support Bart Van Assche
2020-05-16  9:14   ` Avri Altman
2020-05-16 17:14     ` Bart Van Assche
     [not found]     ` <CGME20200516171420epcas2p108c570904c5117c3654d71e0a2842faa@epcms2p7>
2020-05-19 22:31       ` Another approach of UFSHPB yongmyung lee
2020-05-20 17:55         ` Christoph Hellwig
2020-05-20 21:19           ` Bart Van Assche
2020-05-22 16:35             ` Bart Van Assche
2020-05-22 16:49         ` Bart Van Assche
     [not found]         ` <CGME20200516171420epcas2p108c570904c5117c3654d71e0a2842faa@epcms2p4>
2020-05-25  5:40           ` Daejun Park
2020-05-25 14:56             ` Bart Van Assche
2020-05-26  6:15               ` Avri Altman
2020-05-26 17:03                 ` Bart Van Assche
     [not found]                 ` <CGME20200516171420epcas2p108c570904c5117c3654d71e0a2842faa@epcms2p3>
2020-05-27  9:11                   ` Daejun Park
2020-05-27 11:46                     ` Bean Huo

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).