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 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 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] 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

[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 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 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 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 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 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 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 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 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 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) >> >> +

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

[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 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 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

[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 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 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 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 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 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

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 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-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: [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

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: 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

[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 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 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 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 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); > > +

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 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
> > @@ -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
> > > > 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;

[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
> > + > > +/* > > + * 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) > > +{ > > +

[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 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 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

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); > > > > > +

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: [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 2/4] scsi: ufs: L2P map management for HPB read

2021-02-23 Thread Daejun Park
> +/* > > + * This function will parse recommended active subregion information in > > sense > > + * data field of response UPIU with SAM_STAT_GOOD state. > > + */ > > +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > > +{ > > + struct ufshpb_lu *hpb; > > + struct

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

2021-02-23 Thread Daejun Park
> +/* > > + * This function will parse recommended active subregion information in > > sense > > + * data field of response UPIU with SAM_STAT_GOOD state. > > + */ > > +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > > +{ > > +   struct ufshpb_lu *hpb; > > +   struct 

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 state is active, > > +* but

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

2021-02-23 Thread Daejun Park
> > @@ -7447,8 +7452,14 @@ static int ufs_get_device_desc(struct ufs_hba *hba) > > > > if (dev_info->wspecversion >= UFS_DEV_HPB_SUPPORT_VERSION && > > (b_ufs_feature_sup & UFS_DEV_HPB_SUPPORT)) { > > - dev_info->hpb_enabled = true; > > -

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

2021-02-23 Thread Daejun Park
> > + if (!ufshpb_is_hpb_rsp_valid(hba, lrbp, rsp_field)) > > + return; > > + > > + hpb->stats.rb_noti_cnt++; > > > + switch (rsp_field->hpb_op) { > > + case HPB_RSP_NONE: > > + /* nothing to do */ > > + break; > Maybe checks this

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

2021-02-23 Thread Daejun Park
> > +} > > +static DEVICE_ATTR_RW(requeue_timeout_ms); > > + > > +static struct attribute *hpb_dev_param_attrs[] = { > > + _attr_requeue_timeout_ms.attr, > > +}; > > here, you lost a NULL member at the end of attribute struct. > OK, I will. Thanks, Daejun

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

2021-02-23 Thread Daejun Park
> > > > +/* > > > > + * This function will parse recommended active subregion information in > > > > sense > > > > + * data field of response UPIU with SAM_STAT_GOOD state. > > > > + */ > > > > +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > > > > +{ > > > > + struct

[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 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 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

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

2021-02-23 Thread Daejun Park
> > } > > } > > @@ -532,8 +870,8 @@ static int ufshpb_execute_map_req(struct > > ufshpb_lu *hpb, > > if (unlikely(last)) > > mem_size = hpb->last_srgn_entries * HPB_ENTRY_SIZE; > > > > - ufshpb_set_read_buf_cmd(rq->cmd, map_req->rgn_idx, > >

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

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) { > > +

[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 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 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 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

[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 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

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 == >+

[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

[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 v20 1/4] scsi: ufs: Introduce HPB feature

2021-02-17 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 v20 2/4] scsi: ufs: L2P map management for HPB read

2021-02-17 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 | 1048 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1138 insertions(+), 15 deletions(-) diff --git

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

2021-02-17 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 245 ++ drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 249 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 5852ff44c3cc

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

2021-02-17 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 v20 0/4] scsi: ufs: Add Host Performance Booster Support

2021-02-17 Thread Daejun Park
ad 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 support Documenta

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

2021-02-18 Thread Daejun Park
g 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 v21 2/4] scsi: ufs: L2P map management for HPB read

2021-02-18 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 | 1048 - drivers/scsi/ufs/ufshpb.h | 65 +++ 4 files changed, 1138 insertions(+), 15 deletions(-) diff --git

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

2021-02-18 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 v21 4/4] scsi: ufs: Add HPB 2.0 support

2021-02-18 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 v21 3/4] scsi: ufs: Prepare HPB read for cached sub-region

2021-02-18 Thread Daejun Park
Huo Signed-off-by: Daejun Park --- drivers/scsi/ufs/ufshcd.c | 2 + drivers/scsi/ufs/ufshpb.c | 245 ++ drivers/scsi/ufs/ufshpb.h | 2 + 3 files changed, 249 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 5852ff44c3cc

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

2021-02-18 Thread Daejun Park
Sorry for previous mail. Please just ignore that. > > +   /* for pre_req */ > > +   hpb->pre_req_min_tr_len = HPB_MULTI_CHUNK_LOW; > This actually needs to be bMAX_DATA_SIZE_FOR_HPB_SINGLE_CMD.  OK, > Also wasn't able to find any reference to fHPBen?  OK, I will Thanks, Daejun       

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

2021-02-22 Thread Daejun Park
> +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > > +{ > > + struct ufshpb_lu *hpb = ufshpb_get_hpb_data(lrbp->cmd->device); > > + struct utp_hpb_rsp *rsp_field; > > + int data_seg_len; > > + > > + if (!hpb) > > + return; > > + > > +

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

2021-02-22 Thread Daejun Park
> +static bool ufshpb_is_hpb_rsp_valid(struct ufs_hba *hba, > > +struct ufshcd_lrb *lrbp, > > +struct utp_hpb_rsp *rsp_field) > > +{ > > + if (be16_to_cpu(rsp_field->sense_data_len) != DEV_SENSE_SEG_LEN || > > +

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

2021-02-22 Thread Daejun Park
> > kmem_cache_destroy(hpb->map_req_cache); > > @@ -1670,7 +2109,7 @@ void ufshpb_init_hpb_lu(struct ufs_hba *hba, struct > > scsi_device *sdev) > > if (ret) > > goto out; > > > > - hpb = ufshpb_alloc_hpb_lu(hba, lun, >ufshpb_dev, > > + hpb =

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

2021-02-22 Thread Daejun Park
> +static u64 ufshpb_get_ppn(struct ufshpb_lu *hpb, > > + struct ufshpb_map_ctx *mctx, int pos, int *error) > > +{ > > + u64 *ppn_table; > > + struct page *page; > > + int index, offset; > > + > > + index = pos / (PAGE_SIZE / HPB_ENTRY_SIZE); > > +

<    1   2   3   4   >