RE: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-17 Thread Avri Altman
> >> > @@ -1079,6 +1113,14 @@ static void __ufshpb_evict_region(struct > >> > ufshpb_lu *hpb, > >> > > >> > ufshpb_cleanup_lru_info(lru_info, rgn); > >> > > >> > + if (hpb->is_hcm) { > >> > + unsigned long flags; > >> > + > >> > + spin_lock_irqsave(&rgn->rgn_lock,

Re: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-15 Thread Can Guo
On 2021-03-15 17:20, Avri Altman wrote: > + > + if (hpb->is_hcm) { > + spin_lock_irqsave(&rgn->rgn_lock, flags); rgn_lock is never used in IRQ contexts, so no need of irqsave and irqrestore everywhere, which can impact performance. Please correct me if I am wrong.

RE: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-15 Thread Avri Altman
> > + /* if region is active but has no reads - inactivate it */ > > + spin_lock(&hpb->rsp_list_lock); > > + ufshpb_update_inactive_info(hpb, rgn->rgn_idx); > > Miss a hpb->stats.rb_inactive_cnt++ here? Thanks. Also noticed that since rb_inactive_cnt and rb_acti

RE: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-15 Thread Avri Altman
> > + > > + if (hpb->is_hcm) { > > + spin_lock_irqsave(&rgn->rgn_lock, flags); > > rgn_lock is never used in IRQ contexts, so no need of irqsave and > irqrestore everywhere, which can impact performance. Please correct > me if I am wrong. Thanks. Will do. > > Mea

Re: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-15 Thread Can Guo
On 2021-03-02 21:24, Avri Altman wrote: In host control mode, reads are the major source of activation trials. Keep track of those reads counters, for both active as well inactive regions. We reset the read counter upon write - we are only interested in "clean" reads. less intuitive however,

Re: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-14 Thread Can Guo
Hi Avri, On 2021-03-02 21:24, Avri Altman wrote: In host control mode, reads are the major source of activation trials. Keep track of those reads counters, for both active as well inactive regions. We reset the read counter upon write - we are only interested in "clean" reads. less intuitive

Re: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-11 Thread Can Guo
On 2021-03-11 16:04, Avri Altman wrote: > diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c > index 044fec9854a0..a8f8d13af21a 100644 > --- a/drivers/scsi/ufs/ufshpb.c > +++ b/drivers/scsi/ufs/ufshpb.c > @@ -16,6 +16,8 @@ > #include "ufshpb.h" > #include "../sd.h" > > +#define

RE: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-11 Thread Avri Altman
> > diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c > > index 044fec9854a0..a8f8d13af21a 100644 > > --- a/drivers/scsi/ufs/ufshpb.c > > +++ b/drivers/scsi/ufs/ufshpb.c > > @@ -16,6 +16,8 @@ > > #include "ufshpb.h" > > #include "../sd.h" > > > > +#define ACTIVATION_THRESHOLD 4 /

Re: [PATCH v5 03/10] scsi: ufshpb: Add region's reads counter

2021-03-10 Thread Can Guo
Hi Avri, On 2021-03-02 21:24, Avri Altman wrote: In host control mode, reads are the major source of activation trials. Keep track of those reads counters, for both active as well inactive regions. We reset the read counter upon write - we are only interested in "clean" reads. less intuitive