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: <1891546521.01624253881548.JavaMail.epsvc@epcpadp4>
Date:   Mon, 21 Jun 2021 14:17:33 +0900
From:   Daejun Park <daejun7.park@...sung.com>
To:     "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>,
        Daejun Park <daejun7.park@...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>,
        Avri Altman <avri.altman@....com>
Subject: RE: [PATCH v11 08/12] scsi: ufshpb: Add "Cold" regions timer

Hi Avri,

>diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
>index 39b86e8b2eee..cf719831adb3 100644
>--- a/drivers/scsi/ufs/ufshpb.c
>+++ b/drivers/scsi/ufs/ufshpb.c

...

>+static void ufshpb_read_to_handler(struct work_struct *work)
>+{
>+        struct ufshpb_lu *hpb = container_of(work, struct ufshpb_lu,
>+                                             ufshpb_read_to_work.work);
>+        struct victim_select_info *lru_info = &hpb->lru_info;
>+        struct ufshpb_region *rgn, *next_rgn;
>+        unsigned long flags;
>+        LIST_HEAD(expired_list);
>+
>+        if (test_and_set_bit(TIMEOUT_WORK_RUNNING, &hpb->work_data_bits))
>+                return;
>+
>+        spin_lock_irqsave(&hpb->rgn_state_lock, flags);
>+
>+        list_for_each_entry_safe(rgn, next_rgn, &lru_info->lh_lru_rgn,
>+                                 list_lru_rgn) {
>+                bool timedout = ktime_after(ktime_get(), rgn->read_timeout);
>+
>+                if (timedout) {
>+                        rgn->read_timeout_expiries--;
>+                        if (is_rgn_dirty(rgn) ||
>+                            rgn->read_timeout_expiries == 0)
>+                                list_add(&rgn->list_expired_rgn, &expired_list);

Why we need additional expired_list for updating inactive information?
And I think "rgn->list_lru_rgn" should be deleted when it is expired.

>+                        else
>+                                rgn->read_timeout = ktime_add_ms(ktime_get(),
>+                                                         READ_TO_MS);
>+                }
>+        }
>+
>+        spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
>+
>+        list_for_each_entry_safe(rgn, next_rgn, &expired_list,
>+                                 list_expired_rgn) {
>+                list_del_init(&rgn->list_expired_rgn);
>+                spin_lock_irqsave(&hpb->rsp_list_lock, flags);
>+                ufshpb_update_inactive_info(hpb, rgn->rgn_idx);
>+                spin_unlock_irqrestore(&hpb->rsp_list_lock, flags);
>+        }
>+
>+        ufshpb_kick_map_work(hpb);
>+
>+        clear_bit(TIMEOUT_WORK_RUNNING, &hpb->work_data_bits);
>+
>+        schedule_delayed_work(&hpb->ufshpb_read_to_work,
>+                              msecs_to_jiffies(POLLING_INTERVAL_MS));
>+}
>+

Thanks,
Daejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ