Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp801398ybm; Wed, 27 May 2020 08:20:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXdOomxeD2uk3GgCVRv7dH93p0YYu/POW5kSovDnt+AVWdgBCvcGv6rCSAp767Ac0F5Upe X-Received: by 2002:a17:907:b11:: with SMTP id h17mr6793672ejl.497.1590592838321; Wed, 27 May 2020 08:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590592838; cv=none; d=google.com; s=arc-20160816; b=CQvxCgvjx9/w1wjcRrqE5QOaRSH2q2o13n9ZuXr9hcBdrkpYWVMrOKBO+Bzl7yiKxB iccNPb7oJGiAtw85Snn7fMhOBc2U/1CrHjXfGbSJxMJH2Mkx9jI9TYgvRAFtF2HDsiqF tFlzt0G9UUCa3ID7CYKjRuIAoqKDRUUm6rQOt21YQV/5gqLa+Nf0bCIzEie6jfSbLGX3 sjafqtZfE3rHvFIVM5NCuZ1JVCOTZ1rbiZ85jEOugm3HK218/THqL3eFNnooIvdoBlDY Y1hz5UtXhopHpWUCu0AAh/eet7eTPRsZoxUEiK0UByWq85a50oXPYuD0XRW1dClA4rhZ hihQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:content-transfer-encoding:date :message-id:in-reply-to:cc:to:from:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=Dm3JG1JFIBm92Ne8ZPoNhZSsC2dbIoAQEZ/k9FavCTg=; b=G48DbBxh5mJ9n3kjsxV+4diCLa6hSW89KqrCsb5y/dHFD7WeKMsCXUbQicKt8XAsdx +0thjVemYJKMD9XCUgMaduUuKCDoeKIZtHLn63ZDDBOjujvTkX0HdZy51f6nqD5JG/b8 lWKf5FkRsl+QDU0lxxmOjS7k6UU3vSsdifQfX4SQZeLGqYXqc7wRfVrlptX+X8AKrc1t HahZOI3tGFbMp4FjnCKxG4gf1iAJIc1azZj+v4tMHcNJewjUB54DFZqkuRPMwtxAmDH8 BsrKQto4okMMEy+cqwQ4yW6yhqquIBBBsLPwkti9uY7OL8Gx2YDQZfIxaa7Lv2bNMHNO Ab/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uVCPv3Iv; 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 dg13si2002374edb.330.2020.05.27.08.20.15; Wed, 27 May 2020 08:20:38 -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=uVCPv3Iv; 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 S1727026AbgE0JPF (ORCPT + 99 others); Wed, 27 May 2020 05:15:05 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:40139 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbgE0JPF (ORCPT ); Wed, 27 May 2020 05:15:05 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200527091503epoutp037b203c8e27f2ebc48f242027679d6562~S188gENK80411304113epoutp03d for ; Wed, 27 May 2020 09:15:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200527091503epoutp037b203c8e27f2ebc48f242027679d6562~S188gENK80411304113epoutp03d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590570903; bh=Dm3JG1JFIBm92Ne8ZPoNhZSsC2dbIoAQEZ/k9FavCTg=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=uVCPv3Iv1/QfhOj13XaqxIv1jaxjgNCc3r0bNtz54cHXd/QLUN4xchO64XOZ2n/aI ByTiD67uOzPy9y+Dx4SrxLZI8NnYi3dTAd/QNJQYa8qLBirCBI0jVUKZ7uz083YBBI IX3PxzvvsPRBGLzhLi7yHCC1fPFmwA/0QxnInLk4= Received: from epcpadp1 (unknown [182.195.40.11]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20200527091502epcas1p192c155d38ef4f98613a989b482a1aad4~S188EUuYj2923029230epcas1p1c; Wed, 27 May 2020 09:15:02 +0000 (GMT) Mime-Version: 1.0 Subject: Re: Another approach of UFSHPB Reply-To: daejun7.park@samsung.com From: Daejun Park To: Bart Van Assche , Avri Altman , Daejun Park , yongmyung lee , "James E . J . Bottomley" , "Martin K . Petersen" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: ALIM AKHTAR , "asutoshd@codeaurora.org" , Zang Leigang , Avi Shchislowski , Bean Huo , "cang@codeaurora.org" , "stanley.chu@mediatek.com" , MOHAMMED RAFIQ KAMAL BASHA , Sang-yoon Oh , Jinyoung CHOI , Adel Choi , BoRam Shin , Sung-Jun Park X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <231786897.01590570902533.JavaMail.epsvc@epcpadp1> Date: Wed, 27 May 2020 18:11:06 +0900 X-CMS-MailID: 20200527091106epcms2p34428c8cbcda670e0a77cf6eab36ffcb4 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: 20200516171420epcas2p108c570904c5117c3654d71e0a2842faa References: <835c57b9-f792-2460-c3cc-667031969d63@acm.org> <1589538614-24048-1-git-send-email-avri.altman@wdc.com> <231786897.01589928601376.JavaMail.epsvc@epcpadp1> <231786897.01590385382061.JavaMail.epsvc@epcpadp2> <6eec7c64-d4c1-c76e-5c14-7904a8792275@acm.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-26 Bart Van Assche wrote: >On 2020-05-25 23:15, Avri Altman wrote: >>> On 2020-05-24 22:40, Daejun Park wrote: >>>> The HPB driver is close to the UFS core function, but it is not essential >>>> for operating UFS device. With reference to this article >>>> (https://lwn.net/Articles/645810/), we implemented extended UFS-feature >>>> as bus model. Because the HPB driver consumes the user's main memory, it >>> should >>>> support bind / unbind functionality as needed. We implemented the HPB >>> driver >>>> can be unbind / unload on runtime. >>> >>> I do not agree that the bus model is the best choice for freeing cache >>> memory if it is no longer needed. A shrinker is probably a much better >>> choice because the callback functions in a shrinker get invoked when a >>> system is under memory pressure. See also register_shrinker(), >>> unregister_shrinker() and struct shrinker in include/linux/shrinker.h. >> >> Since this discussion is closely related to cache allocation, >> What is your opinion about allocating the pages dynamically as the regions >> Are being activated/deactivated, in oppose of how it is done today - >> Statically on init for the entire max-active-subregions? > Memory that is statically allocated cannot be used for any other purpose > (e.g. page cache) without triggering the associated shrinker. As far as > I know shrinkers are only triggered when (close to) out of memory. So > dynamically allocating memory as needed is probably a better strategy > than statically allocating the entire region at initialization time. To improve UFS device performance using the HPB driver, the number of active-subregions above a certain threshold is essential. If the number of active-subregions is lower than the threshold, the performance improvement by using HPB will be reduced. Also, due to frequent and active/inactive protocol overhead, performance may be worse than when the HPB feature is not used. Therefore, it is better to unbind/unload HPB driver than to reduce the number of active subregions below the threshold. We designed the HPB driver to make the UFS device work even when the module is unloaded. Thanks, Daejun