Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3544437pxj; Mon, 21 Jun 2021 00:44:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6o0m7xEEB/0wbaO6MCO4JEIIftG9GEUPqi3VV9B9K9q0r7XEY4sw8Yn5gfPYiSYxxpWL/ X-Received: by 2002:a02:94af:: with SMTP id x44mr16352798jah.79.1624261451955; Mon, 21 Jun 2021 00:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624261451; cv=none; d=google.com; s=arc-20160816; b=cHJyRZu7ngQa78tgXNq7GrNZXc1ibNGIiDFoFdGAyjtDSTrKo2waGV2cFMSd7FLD/I Ic/eobXw3O/dAigBN8WITbbk4MRgMMLuT7dyfnvaX0u3c8sxQgGoWF1Wmu8ucFzlKMKW eRqSJbzwvVCAPX0ShgutMBBXwTEUs4Gb2XXsHdWTNRHGmhMmTPzFxfXtlnN8Fz/jtQ4c BxZEKZTbomF3IJLECdnNoUKTZIw+42FWzF8Lgrj135nkQwJMvUtDht0UWdvWhO4t2Vt5 GCAmK3z/iTQrsiTf/jH7E4PD+5fxXi+HrmJX2uYv36CIDSbeN5Ha6WlFR3v9S1MxgzSt HMuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:content-transfer-encoding:date :message-id:in-reply-to:cc:to:from:sender:reply-to:subject :mime-version:dkim-signature:dkim-filter; bh=8gSPm9Hg3e41/IwdieaStu9mm6YvGDEAx4oK1XBqGzc=; b=GX3vSpUARbtzcQBN4/SeSsvQFmFeWABOI6VWJjGk22cwB7J+4HoqgS0H+tOn+mEFKe 4qSVLNueZiTKVJ+rcdBgCLwWXQlSQxvQtNc0zvsKegUtNyQ107C1yvMGm3yR6+FG+m+8 +uF40TZYzso5oMfuaty1uJWXefouvhSsVyPl6kxSDfPPAi5iaTDB2BvveASfp+VBKCvU kdTHD7mkU8FvOBKL3lhTSLgkk3dqe10imTLL8V/8UKqWND0/WmpZokxNopDVxvulgzb2 wzDkCtOffqR8X8lRR8nujiSjyO/RfF5doaw0nmcFWiajsnY7ihCDFRdbv3O5LT1su3CW h1kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NnhyLJmU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si16146633iod.29.2021.06.21.00.43.47; Mon, 21 Jun 2021 00:44:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NnhyLJmU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230170AbhFUHnI (ORCPT + 99 others); Mon, 21 Jun 2021 03:43:08 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:26819 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbhFUHmS (ORCPT ); Mon, 21 Jun 2021 03:42:18 -0400 Received: from epcas3p1.samsung.com (unknown [182.195.41.19]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210621074002epoutp02944c6b5493aec91f0c4f7621690c8e3b~KiPVYW11h2355823558epoutp021 for ; Mon, 21 Jun 2021 07:40:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210621074002epoutp02944c6b5493aec91f0c4f7621690c8e3b~KiPVYW11h2355823558epoutp021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1624261202; bh=8gSPm9Hg3e41/IwdieaStu9mm6YvGDEAx4oK1XBqGzc=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=NnhyLJmUZtS2iLJx2E0KMolSGDqayRqbEsQlToOepcd39ao3g1aZXbMu5FRNRRsM5 /fllZf2yiFCVLe/VH1PuNIppgARTz1i5PGmZVGVDrPK+lWNKUFFh/nj1HwnVfIDL91 cn75g4pEAPsE5kdb4HBh8AtIDXE1+bhwK8sOdFpI= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas3p4.samsung.com (KnoxPortal) with ESMTP id 20210621074002epcas3p4706ad612bdd7bd7e1546496f681ba702~KiPUxzgyH2139521395epcas3p4R; Mon, 21 Jun 2021 07:40:02 +0000 (GMT) Received: from epcpadp3 (unknown [182.195.40.17]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4G7hJL1knVz4x9Q4; Mon, 21 Jun 2021 07:40:02 +0000 (GMT) Mime-Version: 1.0 Subject: RE: RE: [PATCH v11 08/12] scsi: ufshpb: Add "Cold" regions timer Reply-To: daejun7.park@samsung.com Sender: Daejun Park From: Daejun Park To: Avri Altman , Daejun Park , "James E . J . Bottomley" , "Martin K . Petersen" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "gregkh@linuxfoundation.org" , Bart Van Assche , yongmyung lee , ALIM AKHTAR , "asutoshd@codeaurora.org" , Zang Leigang , Avi Shchislowski , Bean Huo , "cang@codeaurora.org" , "stanley.chu@mediatek.com" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <1796371666.41624261202246.JavaMail.epsvc@epcpadp3> Date: Mon, 21 Jun 2021 16:33:10 +0900 X-CMS-MailID: 20210621073310epcms2p8e44aca67b76b96c8418bae25442c6d67 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20210616112925epcas2p1267d33aee5fa552333a0503207e262f2 References: <20210616112800.52963-9-avri.altman@wdc.com> <20210616112800.52963-1-avri.altman@wdc.com> <1891546521.01624253881548.JavaMail.epsvc@epcpadp4> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Avri, > > 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? > Since the lru list is accessed under rgn_state_lock, > and inactivation is done under rsp_list_lock, > It's just a convenient way to list all the expired regions. OK, > > > And I think "rgn->list_lru_rgn" should be deleted when it is expired. > Oh - I don't think so. > This should be done in one place only, which is cleanup_lru_info, > Which is called, in host mode, after a successful unmap request. Then I think list_for_each_entry_safe can be changed to list_for_each_entry, because there is no deletion of the list. But it doesn't look like it needs a fix right now. Thanks, Daejun