lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR04MB657517682B016E9879267556FC999@DM6PR04MB6575.namprd04.prod.outlook.com>
Date:   Tue, 2 Mar 2021 09:19:17 +0000
From:   Avri Altman <Avri.Altman@....com>
To:     "daejun7.park@...sung.com" <daejun7.park@...sung.com>,
        "James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        Bart Van Assche <bvanassche@....org>,
        yongmyung lee <ymhungry.lee@...sung.com>,
        ALIM AKHTAR <alim.akhtar@...sung.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        Zang Leigang <zangleigang@...ilicon.com>,
        Avi Shchislowski <Avi.Shchislowski@....com>,
        Bean Huo <beanhuo@...ron.com>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "stanley.chu@...iatek.com" <stanley.chu@...iatek.com>
Subject: RE: [PATCH v4 3/9] scsi: ufshpb: Add region's reads counter

> 
> 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; rgn_idx++) {
> > +                struct ufshpb_region *rgn = hpb->rgn_tbl + rgn_idx;
> 
> *HERE*
> > +                if (rgn->reads) {
> > +                        unsigned long flags;
> > +
> > +                        spin_lock_irqsave(&rgn->rgn_lock, flags);
> 
> I thinks this lock should protect rgn->reads when it is accessed.
> 
> > +                        rgn->reads = (rgn->reads >> 1);
> > +                        spin_unlock_irqrestore(&rgn->rgn_lock, flags);
> > +                }
> *HERE*
Done.

> 
> > +
> > +                if (rgn->rgn_state != HPB_RGN_ACTIVE || rgn->reads)
> > +                        continue;
> > +
> > +                /* if region is active but has no reads - inactivate it */
> > +                spin_lock(&hpb->rsp_list_lock);
> > +                ufshpb_update_inactive_info(hpb, rgn->rgn_idx);
> > +                spin_unlock(&hpb->rsp_list_lock);
> > +        }
> > +
> > +        clear_bit(WORK_PENDING, &hpb->work_data_bits);
> 
> Why we use work_data_bits? It may be checked by worker API.
Done.

> 
> Thanks,
> Daejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ