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 (<= 32KB) is supported as single HPB read.
> >> > In the case of Read (36KB ~ 512KB) is supported by as a combination of
> >> > write buffer command and HPB read command to deliver more 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 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  |   7 +
> >> >  drivers/scsi/ufs/ufshpb.c  | 626 +++--
> >> >  drivers/scsi/ufs/ufshpb.h  |  67 ++-
> >> >  7 files changed, 698 insertions(+), 81 deletions(-)
> >> >
> >> > diff --git a/Documentation/ABI/testing/sysfs-driver-ufs
> >> > b/Documentation/ABI/testing/sysfs-driver-ufs
> >> > index 528bf89fc98b..419adf450b89 100644
> >> > --- a/Documentation/ABI/testing/sysfs-driver-ufs
> >> > +++ b/Documentation/ABI/testing/sysfs-driver-ufs
> >> > @@ -1253,14 +1253,14 @@ Description:This entry shows the number 
> >> > of
> >> > HPB pinned regions assigned to
> >> >
> >> >  The file is read only.
> >> >
> >> > -What:/sys/class/scsi_device/*/device/hpb_sysfs/hit_cnt
> >> > +What:
> >> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/hit_cnt
> >> >  Date:March 2021
> >> >  Contact:Daejun Park 
> >> >  Description:This entry shows the number of reads that changed 
> >> > to HPB
> >> > read.
> >> >
> >> >  The file is read only.
> >> >
> >> > -What:/sys/class/scsi_device/*/device/hpb_sysfs/miss_cnt
> >> > +What:
> >> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/miss_cnt
> >> >  Date:March 2021
> >> >  Contact:Daejun Park 
> >> >  Description:This entry shows the number of reads that cannot be
> >> > changed to
> >> > @@ -1268,7 +1268,7 @@ Description:This entry shows the number of
> >> > reads that cannot be changed to
> >> >
> >> >  The file is read only.
> >> >
> >> > -What:
> >> > /sys/class/scsi_device/*/device/hpb_sysfs/rb_noti_cnt
> >> > +What:
> >> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/rb_noti_cnt
> >> >  Date:March 2021
> >> >  Contact:Daejun Park 
> >> >  Description:This entry shows the number of response UPIUs that 
> >> > has
> >> > @@ -1276,7 +1276,7 @@ Description:This entry shows the number of
> >> > response UPIUs that has
> >> >
> >> >  The file is read only.
> >> >
> >> > -What:
> >> > /sys/class/scsi_device/*/device/hpb_sysfs/rb_active_cnt
> >> > +What:
> >> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/rb_active_cnt
> >> >  Date:March 2021
> >> >  Contact:Daejun Park 
> >> >  Description:This entry shows the number of active sub-regions
> >> > recommended by
> >> > @@ -1284,7 +1284,7 @@ Description:This entry shows the number of
> >> > active sub-regions recommended by
> >> >
> >> >  The file is read only.
> >> >
> >> > -What:
> >> > /sys/class/scsi_device/*/device/hpb_sysfs/rb_inactive_cnt
> >> > +What:
> >> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/rb_inactive_cnt
> >> >  Date:March 2021
> >> >  Contact:Daejun Park 
> >> >  Description:This entry shows the number of inactive regions
> >> > recommended by
> >> > @@ -1292,10 +1292,45 @@ Description:This entry shows the number 
> >> > of
> >> > inactive regions recommended by
> >> >
> >> >  The file is read only.
> >> >
> >> > -What:
> >> > /sys/class/scsi_device/*/device/hpb_sysfs/map_req_cnt
> >> > +What:
> >> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/map_req_cnt
> >> >  Date:March 2021
> >> >  Contact:Daejun Park 
> >> >  Description:This entry shows the number of read buffer commands 
> >> > for
> >> >  activating sub-regions recommended by response UPIUs.
> >> >
> >> >  The file is read only.
> >> > +
> >> > +What:
> >> > /sys/class/scsi_device/*/device/hpb_param_sysfs/requeue_timeout_ms
> >> > +Date:March 2021
> >> > +Contact:

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 ~ 512KB) is supported by as a combination of
> > write buffer command and HPB read command to deliver more 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 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  |   7 +
> >  drivers/scsi/ufs/ufshpb.c  | 626 +++--
> >  drivers/scsi/ufs/ufshpb.h  |  67 ++-
> >  7 files changed, 698 insertions(+), 81 deletions(-)
> > 
> > diff --git a/Documentation/ABI/testing/sysfs-driver-ufs
> > b/Documentation/ABI/testing/sysfs-driver-ufs
> > index 528bf89fc98b..419adf450b89 100644
> > --- a/Documentation/ABI/testing/sysfs-driver-ufs
> > +++ b/Documentation/ABI/testing/sysfs-driver-ufs
> > @@ -1253,14 +1253,14 @@ Description:This entry shows the number of
> > HPB pinned regions assigned to
> > 
> >  The file is read only.
> > 
> > -What:/sys/class/scsi_device/*/device/hpb_sysfs/hit_cnt
> > +What:/sys/class/scsi_device/*/device/hpb_stat_sysfs/hit_cnt
> >  Date:March 2021
> >  Contact:Daejun Park 
> >  Description:This entry shows the number of reads that changed to 
> > HPB 
> > read.
> > 
> >  The file is read only.
> > 
> > -What:/sys/class/scsi_device/*/device/hpb_sysfs/miss_cnt
> > +What:
> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/miss_cnt
> >  Date:March 2021
> >  Contact:Daejun Park 
> >  Description:This entry shows the number of reads that cannot be 
> > changed to
> > @@ -1268,7 +1268,7 @@ Description:This entry shows the number of
> > reads that cannot be changed to
> > 
> >  The file is read only.
> > 
> > -What:/sys/class/scsi_device/*/device/hpb_sysfs/rb_noti_cnt
> > +What:
> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/rb_noti_cnt
> >  Date:March 2021
> >  Contact:Daejun Park 
> >  Description:This entry shows the number of response UPIUs that has
> > @@ -1276,7 +1276,7 @@ Description:This entry shows the number of
> > response UPIUs that has
> > 
> >  The file is read only.
> > 
> > -What:
> > /sys/class/scsi_device/*/device/hpb_sysfs/rb_active_cnt
> > +What:
> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/rb_active_cnt
> >  Date:March 2021
> >  Contact:Daejun Park 
> >  Description:This entry shows the number of active sub-regions 
> > recommended by
> > @@ -1284,7 +1284,7 @@ Description:This entry shows the number of
> > active sub-regions recommended by
> > 
> >  The file is read only.
> > 
> > -What:
> > /sys/class/scsi_device/*/device/hpb_sysfs/rb_inactive_cnt
> > +What:
> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/rb_inactive_cnt
> >  Date:March 2021
> >  Contact:Daejun Park 
> >  Description:This entry shows the number of inactive regions 
> > recommended by
> > @@ -1292,10 +1292,45 @@ Description:This entry shows the number of
> > inactive regions recommended by
> > 
> >  The file is read only.
> > 
> > -What:/sys/class/scsi_device/*/device/hpb_sysfs/map_req_cnt
> > +What:
> > /sys/class/scsi_device/*/device/hpb_stat_sysfs/map_req_cnt
> >  Date:March 2021
> >  Contact:Daejun Park 
> >  Description:This entry shows the number of read buffer commands for
> >  activating sub-regions recommended by response UPIUs.
> > 
> >  The file is read only.
> > +
> > +What:
> > /sys/class/scsi_device/*/device/hpb_param_sysfs/requeue_timeout_ms
> > +Date:March 2021
> > +Contact:Daejun Park 
> > +Description:This entry shows the requeue timeout threshold for 
> > write 
> > buffer
> > +command in ms. This value can be changed by writing proper 
> > integer 
> > to
> > +this entry.
> > +
> > +What:
> > /sys/bus/platform/drivers/ufshcd/*/attributes/max_data_size_hpb_single_cmd
> > +Date:March 2021
> >