[PATCH v3] scsi: ufs: Add batched WB buffer flush

2021-04-20 Thread Daejun Park
-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 9 + drivers/scsi/ufs/ufs-sysfs.c | 47 ++ drivers/scsi/ufs/ufshcd.c | 14 +-- drivers/scsi/ufs/ufshcd.h | 2 + 4 files changed, 68 insertions(+), 4

[PATCH v2] scsi: ufs: Add batched WB buffer flush

2021-04-20 Thread Daejun Park
the device is resumed, fWriteBoosterBufferFlushDuringHibernate is cleared to stop flush during hibern8. Changelog Fix warning reported by kernel test robot. Co-developed-by: Keoseong Park Signed-off-by: Keoseong Park Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 9

[PATCH] scsi: ufs: Add batched WB buffer flush

2021-04-19 Thread Daejun Park
the device is resumed, fWriteBoosterBufferFlushDuringHibernate is cleared to stop flush during hibern8. Co-developed-by: Keoseong Park Signed-off-by: Keoseong Park Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 9 drivers/scsi/ufs/ufs-sysfs.c | 50

RE: [PATCH v17 1/2] scsi: ufs: Enable power management for wlun

2021-04-08 Thread Daejun Park
Hi Asutosh Das, >During runtime-suspend of ufs host, the scsi devices are >already suspended and so are the queues associated with them. >But the ufs host sends SSU (START_STOP_UNIT) to wlun >during its runtime-suspend. >During the process blk_queue_enter checks if the queue is not in >suspended

RE: [PATCH v16 1/2] scsi: ufs: Enable power management for wlun

2021-04-07 Thread Daejun Park
Hi Asutosh Das, >+static inline bool is_rpmb_wlun(struct scsi_device *sdev) >+{ >+return (sdev->lun == >ufshcd_upiu_wlun_to_scsi_wlun(UFS_UPIU_RPMB_WLUN)); >+} >+ >+static inline bool is_device_wlun(struct scsi_device *sdev) >+{ >+return (sdev->lun == >+

RE: Re: [PATCH 1/2] scsi: ufs: Introduce hba performance monitor sysfs nodes

2021-04-06 Thread Daejun Park
Hi Can Guo, > >Hi Daejun, > >On 2021-04-06 12:11, Daejun Park wrote: >> Hi Can Guo, >> >>> +static ssize_t monitor_enable_store(struct device *dev, >>> +struct device_attribute *attr, >>> +

RE: [PATCH 1/2] scsi: ufs: Introduce hba performance monitor sysfs nodes

2021-04-05 Thread Daejun Park
Hi Can Guo, > +static ssize_t monitor_enable_store(struct device *dev, > +struct device_attribute *attr, > +const char *buf, size_t count) > +{ > +struct ufs_hba *hba = dev_get_drvdata(dev); > +unsigned long

RE: [PATCH v7 00/11] Add Host control mode to HPB

2021-04-05 Thread Daejun Park
t; drivers/scsi/ufs/ufshpb.h | 44 ++ > 4 files changed, 663 insertions(+), 35 deletions(-) > The patches in this series look good to me. Reviewed-by: Daejun Park

RE: [PATCH v4 2/2] scsi: ufs: Fix wrong Task Tag used in task management request UPIUs

2021-04-01 Thread Daejun Park
Hi, Can Guo > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c ... > > req->end_io_data = > - free_slot = req->tag; > WARN_ON_ONCE(free_slot < 0 || free_slot >= hba->nutmrs); I think this line should be removed. Thanks, Daejun

[PATCH v32 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-30 Thread Daejun Park
wed-by: Bean Huo Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 47 +- drivers/scsi/ufs/ufs-sysfs.c | 4 + drivers/scsi/ufs/ufs.h | 3 +- drivers/scsi/ufs/ufshcd.c | 25 +- drivers/scsi/ufs/ufshcd.h |

[PATCH v32 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-03-30 Thread Daejun Park
Altman Tested-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 257 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 258 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b

[PATCH v32 2/4] scsi: ufs: L2P map management for HPB read

2021-03-30 Thread Daejun Park
ed-by: Avri Altman Tested-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1088 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1178 insertions(+), 15 deletion

[PATCH v32 1/4] scsi: ufs: Introduce HPB feature

2021-03-30 Thread Daejun Park
-by: Bean Huo Reported-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers

[PATCH v32 0/4] scsi: ufs: Add Host Performance Booster Support

2021-03-30 Thread Daejun Park
stale read. HPB is shown to have a performance improvement of 58 - 67% for random read workload. [1] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs: Introduce HPB feature scsi: ufs: L2P map management for HPB read scsi: ufs: Prepare

RE: Re: [PATCH v31 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-25 Thread Daejun Park
> On 2021-03-25 08:47, Daejun Park wrote: > >> On 2021-03-22 14:55, Daejun Park wrote: > >> > This patch supports the HPB 2.0. > >> > > >> > The HPB 2.0 supports read of varying sizes from 4KB to 512KB. > >> > In the case of Read (

RE: Re: [PATCH v31 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-24 Thread Daejun Park
> On 2021-03-22 14:55, Daejun Park wrote: > > This patch supports the HPB 2.0. > > > > The HPB 2.0 supports read of varying sizes from 4KB to 512KB. > > In the case of Read (<= 32KB) is supported as single HPB read. > > In the case of Read (36KB ~ 512

RE: Re: [PATCH v31 2/4] scsi: ufs: L2P map management for HPB read

2021-03-23 Thread Daejun Park
>On 2021-03-23 14:19, Daejun Park wrote: >>> On 2021-03-23 13:37, Daejun Park wrote: >>>>> On 2021-03-23 12:22, Can Guo wrote: >>>>>> On 2021-03-22 17:11, Bean Huo wrote: >>>>>>> On Mon, 2021-03-22 at 15:54 +0

RE: Re: [PATCH v31 2/4] scsi: ufs: L2P map management for HPB read

2021-03-23 Thread Daejun Park
>On 2021-03-23 13:37, Daejun Park wrote: >>> On 2021-03-23 12:22, Can Guo wrote: >>>> On 2021-03-22 17:11, Bean Huo wrote: >>>>> On Mon, 2021-03-22 at 15:54 +0900, Daejun Park wrote: >>>>>> + switch (rsp_field->hpb

RE: Re: [PATCH v31 2/4] scsi: ufs: L2P map management for HPB read

2021-03-22 Thread Daejun Park
>On 2021-03-23 12:22, Can Guo wrote: >> On 2021-03-22 17:11, Bean Huo wrote: >>> On Mon, 2021-03-22 at 15:54 +0900, Daejun Park wrote: >>>> + switch (rsp_field->hpb_op) { >>>> >>>> + case HPB_RSP_REQ_REGION_UPDATE: >&g

RE: Re: [PATCH v31 2/4] scsi: ufs: L2P map management for HPB read

2021-03-22 Thread Daejun Park
Hi Bean, >On Mon, 2021-03-22 at 15:54 +0900, Daejun Park wrote: >> + switch (rsp_field->hpb_op) { >> >> + case HPB_RSP_REQ_REGION_UPDATE: >> >> + if (data_seg_len != DEV_DATA_SEG_LEN) >> >> +

[PATCH v31 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-22 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v31 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-03-22 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 257 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 258 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v31 2/4] scsi: ufs: L2P map management for HPB read

2021-03-22 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1088 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1178 insertions(+), 15 deletions(-) diff --git

[PATCH v31 1/4] scsi: ufs: Introduce HPB feature

2021-03-22 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v31 0/4] scsi: ufs: Add Host Performance Booster Support

2021-03-22 Thread Daejun Park
formance improvement of 58 - 67% for random read workload. [1] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs: Introduce HPB feature scsi: ufs: L2P map management for HPB read scsi: ufs: Prepare HPB read for cached sub-region scsi: ufs: Ad

[PATCH v30 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-22 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v30 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-03-22 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 257 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 258 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v30 2/4] scsi: ufs: L2P map management for HPB read

2021-03-22 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1088 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1178 insertions(+), 15 deletions(-) diff --git

[PATCH v30 1/4] scsi: ufs: Introduce HPB feature

2021-03-22 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v30 0/4] scsi: ufs: Add Host Performance Booster Support

2021-03-22 Thread Daejun Park
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.

RE: RE: [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-21 Thread Daejun Park
Hi Avri, >> +static int ufshpb_execute_umap_req(struct ufshpb_lu *hpb, >> + struct ufshpb_req *umap_req, >> + struct ufshpb_region *rgn) >> +{ >> + struct request *req; >> + struct scsi_request *rq; >> + >> + req

RE: Re: [PATCH] scsi: ufs: Add selector to ufshcd_query_flag* APIs

2021-03-18 Thread Daejun Park
Hi Martin > >Daejun, > >> Unlike other query APIs in UFS, ufshcd_query_flag has a fixed selector >> as 0. This patch allows ufshcd_query_flag API to choose selector value >> by parameter. > >I don't see any users of the added parameter. Am I missing something? The JEDEC standard describes it

RE: Re: [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-18 Thread Daejun Park
>On 2021-03-18 10:02, Daejun Park wrote: >>> On 2021-03-17 09:42, Daejun Park wrote: >>>>> On 2021-03-15 15:23, Can Guo wrote: >>>>>> On 2021-03-15 15:07, Daejun Park wrote: >>>>>>>>> This patch supports the HPB 2.0. >>&

RE: Re: [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-17 Thread Daejun Park
>On 2021-03-18 10:02, Daejun Park wrote: >>> On 2021-03-17 09:42, Daejun Park wrote: >>>>> On 2021-03-15 15:23, Can Guo wrote: >>>>>> On 2021-03-15 15:07, Daejun Park wrote: >>>>>>>>> This patch supports the HPB 2.0. >>&

RE: Re: [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-17 Thread Daejun Park
>On 2021-03-17 09:42, Daejun Park wrote: >>> On 2021-03-15 15:23, Can Guo wrote: >>>> On 2021-03-15 15:07, Daejun Park wrote: >>>>>>> This patch supports the HPB 2.0. >>>>>>> >>>>>>> The HPB 2.0 supports read

RE: Re: [PATCH v5 05/10] scsi: ufshpb: Region inactivation in host mode

2021-03-16 Thread Daejun Park
>> >> --- >> >> drivers/scsi/ufs/ufshpb.c | 14 ++ >> >> drivers/scsi/ufs/ufshpb.h | 1 + >> >> 2 files changed, 15 insertions(+) >> >> >> >> diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c >> >> index 6f4fd22eaf2f..0744feb4d484 100644

RE: Re: [PATCH v5 05/10] scsi: ufshpb: Region inactivation in host mode

2021-03-16 Thread Daejun Park
>> --- >> drivers/scsi/ufs/ufshpb.c | 14 ++ >> drivers/scsi/ufs/ufshpb.h | 1 + >> 2 files changed, 15 insertions(+) >> >> diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c >> index 6f4fd22eaf2f..0744feb4d484 100644 >> ---

[PATCH] scsi: ufs: Add selector to ufshcd_query_flag* APIs

2021-03-16 Thread Daejun Park
Unlike other query APIs in UFS, ufshcd_query_flag has a fixed selector as 0. This patch allows ufshcd_query_flag API to choose selector value by parameter. Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs-sysfs.c | 2 +- drivers/scsi/ufs/ufshcd.c| 29

RE: RE: [PATCH v5 05/10] scsi: ufshpb: Region inactivation in host mode

2021-03-16 Thread Daejun Park
>> >> --- >> >> drivers/scsi/ufs/ufshpb.c | 14 ++ >> >> drivers/scsi/ufs/ufshpb.h | 1 + >> >> 2 files changed, 15 insertions(+) >> >> >> >> diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c >> >> index 6f4fd22eaf2f..0744feb4d484 100644 >> >> ---

RE: Re: [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-16 Thread Daejun Park
>On 2021-03-15 15:23, Can Guo wrote: >> On 2021-03-15 15:07, Daejun Park wrote: >>>>> This patch supports the HPB 2.0. >>>>> >>>>> The HPB 2.0 supports read of varying sizes from 4KB to 512KB. >>>>> In the case of Read (<

RE: Re: [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-15 Thread Daejun Park
timeout and can be >> modified with requeue_timeout_ms entry in sysfs. >> >> Signed-off-by: Daejun Park >> --- >> +static struct attribute *hpb_dev_param_attrs[] = { >> +_attr_requeue_timeout_ms.attr, >> +NULL, >> +}; &g

RE: Re: [PATCH v26 2/4] scsi: ufs: L2P map management for HPB read

2021-03-14 Thread Daejun Park
;>>> > >>>>> > To gurantee a minimum memory pool size of 4MB: >>>>> > ufshpb_host_map_kbytes=4096 >>>>> > >>>>> > The map_work manages active/inactive by 2 "to-do" lists. >>>>> > Eac

[PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-14 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v29 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-03-14 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 256 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 257 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v29 2/4] scsi: ufs: L2P map management for HPB read

2021-03-14 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1094 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1184 insertions(+), 15 deletions(-) diff --git

[PATCH v29 1/4] scsi: ufs: Introduce HPB feature

2021-03-14 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v29 0/4] scsi: ufs: Add Host Performance Booster Support

2021-03-14 Thread Daejun Park
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] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs:

[PATCH v28 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-12 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v28 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-03-12 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 256 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 257 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v28 2/4] scsi: ufs: L2P map management for HPB read

2021-03-12 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1094 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1184 insertions(+), 15 deletions(-) diff --git

[PATCH v28 1/4] scsi: ufs: Introduce HPB feature

2021-03-12 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v28 0/4] scsi: ufs: Add Host Performance Booster Support

2021-03-12 Thread Daejun Park
nting stale read. HPB is shown to have a performance improvement of 58 - 67% for random read workload. [1] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs: Introduce HPB feature scsi: ufs: L2P map management for HPB read scsi: ufs

[PATCH v27 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-12 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v27 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-03-12 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 256 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 257 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v27 2/4] scsi: ufs: L2P map management for HPB read

2021-03-12 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1094 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1184 insertions(+), 15 deletions(-) diff --git

[PATCH v27 1/4] scsi: ufs: Introduce HPB feature

2021-03-12 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v27 0/4] scsi: ufs: Add Host Performance Booster Support

2021-03-12 Thread Daejun Park
rovement of 58 - 67% for random read workload. [1] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs: Introduce HPB feature scsi: ufs: L2P map management for HPB read scsi: ufs: Prepare HPB read for cached sub-region scsi: ufs: Ad

RE: Re: [PATCH v26 2/4] scsi: ufs: L2P map management for HPB read

2021-03-11 Thread Daejun Park
t; > as a module parameter, so that it can be configurable by the user. >>> > >>> > To gurantee a minimum memory pool size of 4MB: >>> > ufshpb_host_map_kbytes=4096 >>> > >>> > The map_work manages active/inactive by 2 "to-do" list

RE: Re: [PATCH v26 2/4] scsi: ufs: L2P map management for HPB read

2021-03-11 Thread Daejun Park
k manages active/inactive by 2 "to-do" lists. > > Each hpb lun maintains 2 "to-do" lists: > > hpb->lh_inact_rgn - regions to be inactivated, and > > hpb->lh_act_srgn - subregions to be activated > > Those lists are maintained on IO completion. > &g

RE: Re: [PATCH v26 2/4] scsi: ufs: L2P map management for HPB read

2021-03-11 Thread Daejun Park
> Each hpb lun maintains 2 "to-do" lists: > > hpb->lh_inact_rgn - regions to be inactivated, and > > hpb->lh_act_srgn - subregions to be activated > > Those lists are maintained on IO completion. > > > > Reviewed-by: Bart

RE: Re: [PATCH v26 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-04 Thread Daejun Park
Hi Bean, > > + > > +static inline int ufshpb_get_read_id(struct ufshpb_lu *hpb) > > +{ > > + if (++hpb->cur_read_id >= MAX_HPB_READ_ID) > > + hpb->cur_read_id = 0; > > + return hpb->cur_read_id; > > +} > > + > > +static int ufshpb_execute_pre_req(struct ufshpb_lu *hpb,

RE: Re: [PATCH v26 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-04 Thread Daejun Park
Hi, Can Guo > > diff --git a/drivers/scsi/ufs/ufs-sysfs.c > > b/drivers/scsi/ufs/ufs-sysfs.c > > index 2546e7a1ac4f..00fb519406cf 100644 > > --- a/drivers/scsi/ufs/ufs-sysfs.c > > +++ b/drivers/scsi/ufs/ufs-sysfs.c > > @@ -841,6 +841,7 @@ out:

RE: Re: [PATCH v26 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-04 Thread Daejun Park
Hi Bean, > > + > > +static inline void ufshpb_put_pre_req(struct ufshpb_lu *hpb, > > + struct ufshpb_req *pre_req) > > +{ > > + pre_req->req = NULL; > > + pre_req->bio = NULL; > > + list_add_tail(_req->list_req, >lh_pre_req_free); > > +

[PATCH v26 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-03 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v26 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-03-03 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 253 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 254 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v26 2/4] scsi: ufs: L2P map management for HPB read

2021-03-03 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1091 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1181 insertions(+), 15 deletions(-) diff --git

[PATCH v26 1/4] scsi: ufs: Introduce HPB feature

2021-03-03 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v26 0/4] scsi: ufs: Add Host Performance Booster Support

2021-03-03 Thread Daejun Park
sociated 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] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs: Introduce HPB feature scsi: ufs: L2P

RE: Re: [PATCH v25 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-03 Thread Daejun Park
> > @@ -1812,8 +2307,9 @@ void ufshpb_get_geo_info(struct ufs_hba *hba, u8 > > *geo_buf) > > void ufshpb_get_dev_info(struct ufs_hba *hba, u8 *desc_buf) > > { > > struct ufshpb_dev_info *hpb_dev_info = >ufshpb_dev; > > -int version; > > +int version, ret; > >

RE: Re: [PATCH v25 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-03 Thread Daejun Park
> > +bool ufshpb_is_legacy(struct ufs_hba *hba) > > +{ > > +return hba->ufshpb_dev.is_legacy; > > +} > > + > > static struct ufshpb_lu *ufshpb_get_hpb_data(struct scsi_device *sdev) > > { > > return sdev->hostdata; > > @@ -64,9 +69,19 @@ static bool

RE: Re: [PATCH v25 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-03 Thread Daejun Park
> > > > static void __ufshpb_evict_region(struct ufshpb_lu *hpb, > >struct ufshpb_region *rgn) > > { > > @@ -1209,6 +1579,16 @@ static void ufshpb_lu_parameter_init(struct > > ufs_hba *hba, > > u32 entries_per_rgn; > > u64 rgn_mem_size, tmp;

RE: Re: [PATCH v25 4/4] scsi: ufs: Add HPB 2.0 support

2021-03-03 Thread Daejun Park
> > + > > +/* > > + * In this driver, WRITE_BUFFER CMD support 36KB (len=9) ~ 512KB > > (len=128) as > > + * default. It is possible to change range of transfer_len through > > sysfs. > > + */ > > +static inline bool ufshpb_is_required_wb(struct ufshpb_lu *hpb, int > > len) > > +{ > > +

RE: RE: [PATCH v4 7/9] scsi: ufshpb: Add "Cold" regions timer

2021-03-02 Thread Daejun Park
Hi Avri, > > > > Hi Avri, > > > > > +static void ufshpb_read_to_handler(struct work_struct *work) > > > +{ > > > +struct delayed_work *dwork = to_delayed_work(work); > > > +struct ufshpb_lu *hpb; > > > +struct victim_select_info *lru_info; > > > +struct

RE: [PATCH v4 3/9] scsi: ufshpb: Add region's reads counter

2021-03-02 Thread Daejun Park
Hi Avri, > +static void ufshpb_normalization_work_handler(struct work_struct *work) > +{ > +struct ufshpb_lu *hpb; > +int rgn_idx; > + > +hpb = container_of(work, struct ufshpb_lu, > ufshpb_normalization_work); > + > +for (rgn_idx = 0; rgn_idx < hpb->rgns_per_lu;

RE: [PATCH v4 7/9] scsi: ufshpb: Add "Cold" regions timer

2021-03-02 Thread Daejun Park
Hi Avri, > +static void ufshpb_read_to_handler(struct work_struct *work) > +{ > +struct delayed_work *dwork = to_delayed_work(work); > +struct ufshpb_lu *hpb; > +struct victim_select_info *lru_info; > +struct ufshpb_region *rgn; > +unsigned long flags; > +

RE: [PATCH v4 6/9] scsi: ufshpb: Add hpb dev reset response

2021-03-02 Thread Daejun Park
Hi Avri, > diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c > index cf704b82e72a..f33aa28e0a0a 100644 > --- a/drivers/scsi/ufs/ufshpb.c > +++ b/drivers/scsi/ufs/ufshpb.c > @@ -642,7 +642,8 @@ int ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb > *lrbp) > if

[PATCH v25 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-25 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 253 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 254 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v25 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-25 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v25 2/4] scsi: ufs: L2P map management for HPB read

2021-02-25 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1091 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1181 insertions(+), 15 deletions(-) diff --git

[PATCH v25 1/4] scsi: ufs: Introduce HPB feature

2021-02-25 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v25 0/4] scsi: ufs: Add Host Performance Booster Support

2021-02-25 Thread Daejun Park
ndom read workload. [1] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs: Introduce HPB feature scsi: ufs: L2P map management for HPB read scsi: ufs: Prepare HPB read for cached sub-region scsi: ufs: Add HPB 2.0 supp

RE: Re: [PATCH v24 2/4] scsi: ufs: L2P map management for HPB read

2021-02-25 Thread Daejun Park
> > +static int ufshpb_init_mem_wq(void) > > +{ > > + int ret; > > + unsigned int pool_size; > > + > > + ufshpb_mctx_cache = kmem_cache_create("ufshpb_mctx_cache", > > + sizeof(struct > > ufshpb_map_ctx), > > +

RE: Re: [PATCH v24 1/4] scsi: ufs: Introduce HPB feature

2021-02-25 Thread Daejun Park
> > > > +void ufshpb_init(struct ufs_hba *hba) > > +{ > > +struct ufshpb_dev_info *hpb_dev_info = >ufshpb_dev; > > +int try; > > +int ret; > > + > > +if (!ufshpb_is_allowed(hba)) > > +return; > > + > > Here it is better to check

RE: RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Daejun Park
> > if (dev_info->wspecversion >= UFS_DEV_HPB_SUPPORT_VERSION && > > (b_ufs_feature_sup & UFS_DEV_HPB_SUPPORT)) { > > - dev_info->hpb_enabled = true; > > + bool hpb_en = false; > > + > > ufshpb_get_dev_info(hba, desc_buf); > > + > > +

RE: RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Daejun Park
> > > > > +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb) > > Maybe ufshpb_issue_umap_all_req is just a wrapper for > > ufshpb_issue_umap_req? > > e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ? > > Then on host mode inactivation: > > static int

RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Daejun Park
> > + copied = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, > > + pre_req->wb.len - offset, > > + [offset]); > > + > > + if (copied < 0) > > + goto mctx_error; > > + > > +

RE: RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-24 Thread Daejun Park
> > > > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct > > > Scsi_Host > > > > > *host, struct scsi_cmnd *cmd) > > > > > > > > > > lrbp->req_abort_skip = false; > > > > > > > > > > - ufshpb_prep(hba, lrbp); > > > > > + err = ufshpb_prep(hba, lrbp); > > > > > +

[PATCH v24 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 253 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 254 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-23 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v24 2/4] scsi: ufs: L2P map management for HPB read

2021-02-23 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1091 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1181 insertions(+), 15 deletions(-) diff --git

[PATCH v24 1/4] scsi: ufs: Introduce HPB feature

2021-02-23 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v24 0/4] scsi: ufs: Add Host Performance Booster Support

2021-02-23 Thread Daejun Park
mprovement of 58 - 67% for random read workload. [1] [1]: https://www.usenix.org/conference/hotstorage17/program/presentation/jeong Daejun Park (4): scsi: ufs: Introduce HPB feature scsi: ufs: L2P map management for HPB read scsi: ufs: Prepare HPB read for cached sub-region scsi: ufs: Add HPB

[PATCH v23 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-23 Thread Daejun Park
PPN. The write buffer commands may not be issued immediately due to busy tags. To use HPB read more aggressively, the driver can requeue the write buffer command. The requeue threshold is implemented as timeout and can be modified with requeue_timeout_ms entry in sysfs. Signed-off-by: Daejun P

[PATCH v23 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 253 +- drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 254 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

[PATCH v23 2/4] scsi: ufs: L2P map management for HPB read

2021-02-23 Thread Daejun Park
d-by: Bean Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufs.h| 36 ++ drivers/scsi/ufs/ufshcd.c |4 + drivers/scsi/ufs/ufshpb.c | 1091 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1181 insertions(+), 15 deletions(-) diff --git

[PATCH v23 1/4] scsi: ufs: Introduce HPB feature

2021-02-23 Thread Daejun Park
-by: kernel test robot Signed-off-by: Daejun Park --- Documentation/ABI/testing/sysfs-driver-ufs | 127 + drivers/scsi/ufs/Kconfig | 9 + drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 18 + drivers/scsi/ufs/ufs.h

[PATCH v23 0/4] scsi: ufs: Add Host Performance Booster Support

2021-02-23 Thread Daejun Park
shpb_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] [1]: https://www

RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-23 Thread Daejun Park
> > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct Scsi_Host > > *host, struct scsi_cmnd *cmd) > > > > lrbp->req_abort_skip = false; > > > > - ufshpb_prep(hba, lrbp); > > + err = ufshpb_prep(hba, lrbp); > > + if (err == -EAGAIN) { > > +

RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Daejun Park
> > +static int ufshpb_fill_ppn_from_page(struct ufshpb_lu *hpb, > > +struct ufshpb_map_ctx *mctx, int pos, > > +int len, u64 *ppn_buf) > > +{ > > + struct page *page; > > + int index, offset; > > + int

RE: RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-23 Thread Daejun Park
> > > > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, > > > > > 1, > > > ); > > > > > + spin_unlock_irqrestore(>rgn_state_lock, flags); > > > > > + if (unlikely(err < 0)) { > > > > > + /* > > > > > +* In this case, the region

  1   2   3   4   >