mbox series

[v8,0/4] scsi: ufs: Add Host Performance Booster Support

Message ID 231786897.01596704281715.JavaMail.epsvc@epcpadp2 (mailing list archive)
Headers show
Series scsi: ufs: Add Host Performance Booster Support | expand

Message

Daejun Park Aug. 6, 2020, 7:32 a.m. UTC
Changelog:

v7 -> v8
Remove wrongly added tags.

v6 -> v7
1. Remove UFS feature layer.
2. Cleanup for sparse error.

v5 -> v6
Change base commit to b53293fa662e28ae0cdd40828dc641c09f133405

v4 -> v5
Delete unused macro define.

v3 -> v4
1. Cleanup.

v2 -> v3
1. Add checking input module parameter value.
2. Change base commit from 5.8/scsi-queue to 5.9/scsi-queue.
3. Cleanup for unused variables and label.

v1 -> v2
1. Change the full boilerplate text to SPDX style.
2. Adopt dynamic allocation for sub-region data structure.
3. Cleanup.

NAND flash memory-based storage devices use Flash Translation Layer (FTL)
to translate logical addresses of I/O requests to corresponding flash
memory addresses. Mobile storage devices typically have RAM with
constrained size, thus lack in memory to keep the whole mapping table.
Therefore, mapping tables are partially retrieved from NAND flash on
demand, causing random-read performance degradation.

To improve random read performance, JESD220-3 (HPB v1.0) proposes HPB
(Host Performance Booster) which uses host system memory as a cache for the
FTL mapping table. By using HPB, FTL data can be read from host memory
faster than from NAND flash memory. 

The current version only supports the DCM (device control mode).
This patch consists of 3 parts to support HPB feature.

1) HPB probe and initialization process
2) READ -> HPB READ using cached map information
3) L2P (logical to physical) map management

In the HPB probe and init process, the device information of the UFS is
queried. After checking supported features, the data structure for the HPB
is initialized according to the device information.

A read I/O in the active sub-region where the map is cached is changed to
HPB READ by the HPB.

The HPB manages the L2P map using information received from the
device. For active sub-region, the HPB caches through ufshpb_map
request. For the in-active region, the HPB discards the L2P map.
When a write I/O occurs in an active sub-region area, associated dirty
bitmap checked as dirty for preventing stale read.

HPB is shown to have a performance improvement of 58 - 67% for random read
workload. [1]

This series patches are based on the 5.9/scsi-queue branch.

[1]:
https://www.usenix.org/conference/hotstorage17/program/presentation/jeong

Daejun park (4):
 scsi: ufs: Add UFS feature related parameter
 scsi: ufs: Introduce HPB feature
 scsi: ufs: L2P map management for HPB read
 scsi: ufs: Prepare HPB read for cached sub-region
 
 drivers/scsi/ufs/Kconfig  |   18 +
 drivers/scsi/ufs/Makefile |    1 +
 drivers/scsi/ufs/ufs.h    |   12 +
 drivers/scsi/ufs/ufshcd.c |   42 +
 drivers/scsi/ufs/ufshcd.h |    9 +
 drivers/scsi/ufs/ufshpb.c | 1926 ++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/ufs/ufshpb.h |  241 +++++
 7 files changed, 2249 insertions(+)
 created mode 100644 drivers/scsi/ufs/ufshpb.c
 created mode 100644 drivers/scsi/ufs/ufshpb.h

Comments

Bean Huo Aug. 6, 2020, 9:52 a.m. UTC | #1
Hi Avri
what is your plan for this series patchset?

Bean
Avri Altman Aug. 6, 2020, 9:56 a.m. UTC | #2
> 
> Hi Avri
> what is your plan for this series patchset?
I already acked it.
Waiting for the senior members to decide.

Thanks,
Avri

> 
> Bean
Bean Huo Aug. 6, 2020, 10:02 a.m. UTC | #3
On Thu, 2020-08-06 at 09:56 +0000, Avri Altman wrote:
> > 
> > Hi Avri
> > what is your plan for this series patchset?
> 
> I already acked it.
> Waiting for the senior members to decide.
> 
> Thanks,
> Avri
> 
> > 
> > Bean
> 
> 
we didn't see you Acked-by in the pathwork, would you like to add them?
Just for reminding us that you have agreed to mainline this series
patchset.


thanks,
Bean
Avri Altman Aug. 6, 2020, 10:12 a.m. UTC | #4
> 
> On Thu, 2020-08-06 at 09:56 +0000, Avri Altman wrote:
> > >
> > > Hi Avri
> > > what is your plan for this series patchset?
> >
> > I already acked it.
> > Waiting for the senior members to decide.
> >
> > Thanks,
> > Avri
> >
> > >
> > > Bean
> >
> >
> we didn't see you Acked-by in the pathwork, would you like to add them?
> Just for reminding us that you have agreed to mainline this series
> patchset.
I acked it - https://www.spinics.net/lists/linux-scsi/msg144660.html
And asked Martin to move forward - https://www.spinics.net/lists/linux-scsi/msg144738.html
Which he did, and got some sparse errors: https://www.spinics.net/lists/linux-scsi/msg144977.html
Which I asked Daejun to fix - https://www.spinics.net/lists/linux-scsi/msg144987.html

For the next chain of events I guess you can follow by yourself.

Thanks,
Avri
Bean Huo Aug. 6, 2020, 10:28 a.m. UTC | #5
On Thu, 2020-08-06 at 10:12 +0000, Avri Altman wrote:
> > > 
> > 
> > we didn't see you Acked-by in the pathwork, would you like to add
> > them?
> > Just for reminding us that you have agreed to mainline this series
> > patchset.
> 
> I acked it - https://www.spinics.net/lists/linux-scsi/msg144660.html
> And asked Martin to move forward - 
> https://www.spinics.net/lists/linux-scsi/msg144738.html
> Which he did, and got some sparse errors: 
> https://www.spinics.net/lists/linux-scsi/msg144977.html
> Which I asked Daejun to fix - 
> https://www.spinics.net/lists/linux-scsi/msg144987.html
> 
> For the next chain of events I guess you can follow by yourself.
> 
> Thanks,
> Avri

Avri
Sorry for making you confusing. yes, I knew that, and following.
I mean Acked-by tag in the patchset, then we see your acked in the
patchwork, and let others know that you acked it, rather than going
backtrack history email.

Hi Daejun
I think you can add Avri's Acked-by tag in your patchset, just for
quickly moving forward and reminding.

thanks,
Bean
Avri Altman Aug. 6, 2020, 1:56 p.m. UTC | #6
> 
> On Thu, 2020-08-06 at 10:12 +0000, Avri Altman wrote:
> > > >
> > >
> > > we didn't see you Acked-by in the pathwork, would you like to add
> > > them?
> > > Just for reminding us that you have agreed to mainline this series
> > > patchset.
> >
> > I acked it - https://www.spinics.net/lists/linux-scsi/msg144660.html
> > And asked Martin to move forward -
> > https://www.spinics.net/lists/linux-scsi/msg144738.html
> > Which he did, and got some sparse errors:
> > https://www.spinics.net/lists/linux-scsi/msg144977.html
> > Which I asked Daejun to fix -
> > https://www.spinics.net/lists/linux-scsi/msg144987.html
> >
> > For the next chain of events I guess you can follow by yourself.
> >
> > Thanks,
> > Avri
> 
> Avri
> Sorry for making you confusing. yes, I knew that, and following.
> I mean Acked-by tag in the patchset, then we see your acked in the
> patchwork, and let others know that you acked it, rather than going
> backtrack history email.
> 
> Hi Daejun
> I think you can add Avri's Acked-by tag in your patchset, just for
> quickly moving forward and reminding.
Ahhh - One moment please - 
While rebasing the v8 on my platform, I noticed some substantial changes since v6.
e.g. the hpb lun ref counting isn't there anymore, as well as some more stuff.
While those changes might be only for the best,  I think any tested-by tag should be re-assign.

Anyway, as for myself, I am not planning to put any more time in this,
until there is a clear decision where this series is going to.

Martin - Are you considering to merge the HPB feature eventually to mainline kernel?

Thanks,
Avri
> 
> thanks,
> Bean
Alim Akhtar Aug. 6, 2020, 4:36 p.m. UTC | #7
> -----Original Message-----
> From: Avri Altman <Avri.Altman@wdc.com>
> Sent: 06 August 2020 19:27
> To: Bean Huo <huobean@gmail.com>; daejun7.park@samsung.com;
> jejb@linux.ibm.com; martin.petersen@oracle.com; asutoshd@codeaurora.org;
> beanhuo@micron.com; stanley.chu@mediatek.com; cang@codeaurora.org;
> bvanassche@acm.org; tomas.winkler@intel.com; ALIM AKHTAR
> <alim.akhtar@samsung.com>
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; Sang-yoon Oh
> <sangyoon.oh@samsung.com>; Sung-Jun Park
> <sungjun07.park@samsung.com>; yongmyung lee
> <ymhungry.lee@samsung.com>; Jinyoung CHOI <j-young.choi@samsung.com>;
> Adel Choi <adel.choi@samsung.com>; BoRam Shin
> <boram.shin@samsung.com>
> Subject: RE: [PATCH v8 0/4] scsi: ufs: Add Host Performance Booster Support
> 
> 
> >
> > On Thu, 2020-08-06 at 10:12 +0000, Avri Altman wrote:
> > > > >
> > > >
> > > > we didn't see you Acked-by in the pathwork, would you like to add
> > > > them?
> > > > Just for reminding us that you have agreed to mainline this series
> > > > patchset.
> > >
> > > I acked it -
> > > https://protect2.fireeye.com/url?k=039c5a1c-5e48e674-039dd153-0cc47a
> > > 3356b2-
> 66867eb5b9700b6a&q=1&u=https%3A%2F%2Fwww.spinics.net%2Flists%
> > > 2Flinux-scsi%2Fmsg144660.html
> > > And asked Martin to move forward -
> > > https://protect2.fireeye.com/url?k=94dceb38-c9085750-94dd6077-0cc47a
> > > 3356b2-
> 19ab1f41f48ff179&q=1&u=https%3A%2F%2Fwww.spinics.net%2Flists%
> > > 2Flinux-scsi%2Fmsg144738.html Which he did, and got some sparse
> > > errors:
> > > https://protect2.fireeye.com/url?k=a40e2dd1-f9da91b9-a40fa69e-0cc47a
> > > 3356b2-
> 81fae05297aebb0e&q=1&u=https%3A%2F%2Fwww.spinics.net%2Flists%
> > > 2Flinux-scsi%2Fmsg144977.html
> > > Which I asked Daejun to fix -
> > > https://protect2.fireeye.com/url?k=6badf100-36794d68-6bac7a4f-0cc47a
> > > 3356b2-
> f84580e236611583&q=1&u=https%3A%2F%2Fwww.spinics.net%2Flists%
> > > 2Flinux-scsi%2Fmsg144987.html
> > >
> > > For the next chain of events I guess you can follow by yourself.
> > >
> > > Thanks,
> > > Avri
> >
> > Avri
> > Sorry for making you confusing. yes, I knew that, and following.
> > I mean Acked-by tag in the patchset, then we see your acked in the
> > patchwork, and let others know that you acked it, rather than going
> > backtrack history email.
> >
> > Hi Daejun
> > I think you can add Avri's Acked-by tag in your patchset, just for
> > quickly moving forward and reminding.
> Ahhh - One moment please -
> While rebasing the v8 on my platform, I noticed some substantial changes since
> v6.
> e.g. the hpb lun ref counting isn't there anymore, as well as some more stuff.
> While those changes might be only for the best,  I think any tested-by tag should
> be re-assign.
> 
> Anyway, as for myself, I am not planning to put any more time in this, until there
> is a clear decision where this series is going to.
> 
> Martin - Are you considering to merge the HPB feature eventually to mainline
> kernel?
> 
V8 has removed the "UFS feature layer" which was  the main topic of discussion. What else we thing is blocking this to be in mainline?
Bart / Martin, any thought?


> Thanks,
> Avri
> >
> > thanks,
> > Bean
Bart Van Assche Aug. 6, 2020, 6:39 p.m. UTC | #8
On 2020-08-06 09:36, Alim Akhtar wrote:
> V8 has removed the "UFS feature layer" which was  the main topic of discussion. What else we thing is blocking this to be in mainline?
> Bart / Martin, any thought?

Thank you for having posted a version with the UFS feature layer removed. I
will try to find some time this weekend to review version 8 of this patch
series.

Bart.
Daejun Park Aug. 6, 2020, 11:15 p.m. UTC | #9
Hi Avri,
> > 
> > On Thu, 2020-08-06 at 10:12 +0000, Avri Altman wrote:
> > > > >
> > > >
> > > > we didn't see you Acked-by in the pathwork, would you like to add
> > > > them?
> > > > Just for reminding us that you have agreed to mainline this series
> > > > patchset.
> > >
> > > I acked it - https://protect2.fireeye.com/v1/url?k=0669baeb-5ba5764e-066831a4-0cc47a30d446-27c87d7023437946&q=1&e=cf195d42-fec6-43bb-b797-203c71fd6665&u=https%3A%2F%2Fwww.spinics.net%2Flists%2Flinux-scsi%2Fmsg144660.html
> > > And asked Martin to move forward -
> > > https://protect2.fireeye.com/v1/url?k=f5035541-a8cf99e4-f502de0e-0cc47a30d446-b2b42329eddc02dc&q=1&e=cf195d42-fec6-43bb-b797-203c71fd6665&u=https%3A%2F%2Fwww.spinics.net%2Flists%2Flinux-scsi%2Fmsg144738.html
> > > Which he did, and got some sparse errors:
> > > https://protect2.fireeye.com/v1/url?k=242040ce-79ec8c6b-2421cb81-0cc47a30d446-4d1c0f96a36b8f4d&q=1&e=cf195d42-fec6-43bb-b797-203c71fd6665&u=https%3A%2F%2Fwww.spinics.net%2Flists%2Flinux-scsi%2Fmsg144977.html
> > > Which I asked Daejun to fix -
> > > https://protect2.fireeye.com/v1/url?k=44587fa8-1994b30d-4459f4e7-0cc47a30d446-d01ce202f9a3c6b5&q=1&e=cf195d42-fec6-43bb-b797-203c71fd6665&u=https%3A%2F%2Fwww.spinics.net%2Flists%2Flinux-scsi%2Fmsg144987.html
> > >
> > > For the next chain of events I guess you can follow by yourself.
> > >
> > > Thanks,
> > > Avri
> > 
> > Avri
> > Sorry for making you confusing. yes, I knew that, and following.
> > I mean Acked-by tag in the patchset, then we see your acked in the
> > patchwork, and let others know that you acked it, rather than going
> > backtrack history email.
> > 
> > Hi Daejun
> > I think you can add Avri's Acked-by tag in your patchset, just for
> > quickly moving forward and reminding.
> Ahhh - One moment please - 
> While rebasing the v8 on my platform, I noticed some substantial changes since v6.
> e.g. the hpb lun ref counting isn't there anymore, as well as some more stuff.
> While those changes might be only for the best,  I think any tested-by tag should be re-assign.

In this version, the HPB is no more loadable module, it is sticked with
UFS-core driver. So, I removed reference counter for HPB.

> Anyway, as for myself, I am not planning to put any more time in this,
> until there is a clear decision where this series is going to.
> 
> Martin - Are you considering to merge the HPB feature eventually to mainline kernel?
> 
> Thanks,
> Avri
> > 
> > thanks,
> > Bean
> 
> 
Thanks,
Daejun
Martin K. Petersen Aug. 7, 2020, 4:32 a.m. UTC | #10
Avri,

> Martin - Are you considering to merge the HPB feature eventually to
> mainline kernel?

I promise to take a look at the new series. But I can't say I'm a big
fan of how this feature was defined in the spec.

And - as discussed a couple of weeks ago - I would still like to see
some supporting evidence from a realistic workload and not a synthetic
benchmark.