From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752779AbcFVO5P (ORCPT ); Wed, 22 Jun 2016 10:57:15 -0400 Received: from mail-bl2on0095.outbound.protection.outlook.com ([65.55.169.95]:29856 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751355AbcFVO5K (ORCPT ); Wed, 22 Jun 2016 10:57:10 -0400 From: Alex Lemberg To: Ulf Hansson CC: Adrian Hunter , Shawn Lin , Jaehoon Chung , linux-mmc , "linux-kernel@vger.kernel.org" , Doug Anderson , "open list:ARM/Rockchip SoC..." Subject: Re: [PATCH] mmc: core: add auto bkops support Thread-Topic: [PATCH] mmc: core: add auto bkops support Thread-Index: AQHRv6CfUecJptXFn0uOY9vptpBOzJ/m+nwAgAAWJYCAAAghgIAAC5wAgAA51ICADgJUgIAAdQ2A///P1YCAADpNgA== Date: Wed, 22 Jun 2016 14:57:05 +0000 Message-ID: <362217AA-5AE7-471A-AF58-985676E261A4@sandisk.com> References: <1465182439-27963-1-git-send-email-shawn.lin@rock-chips.com> <575E52AC.6000902@intel.com> <8bbb3f13-efb3-e963-e53f-cf2ca796f319@rock-chips.com> <575E6C11.8060709@intel.com> <575EA651.7060606@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/f.16.0.160506 authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alex.Lemberg@sandisk.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [212.25.79.133] x-ms-office365-filtering-correlation-id: 13828aa9-770a-4c2e-411a-08d39aad7a66 x-microsoft-exchange-diagnostics: 1;BL2PR02MB2018;20:o3bsECe3yq3Fk2qVA4IcduhWXBN+XyXYlMgMmwG83NBgm8hPlL1qoqFph5LkZXmmxovE5T69rlPmqqv7lUyZPUzw1NCqwN73Cxc1Srtkizkvrum0O5I0k5yFkAkvLD2neeQTLV3Xo7bYr2TTcuqcO7uCakI4U2NwhHvabiTLysGTDgD6jGsvf3LDRU+onz2mqVTgpzM/5NNgE9WVzmhIMg/jUa7jLbXbb9rTJTpPfrlINiroAZ/Jds4/sAlBQhxC x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR02MB2018; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(42932892334569)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:BL2PR02MB2018;BCL:0;PCL:0;RULEID:;SRVR:BL2PR02MB2018; x-forefront-prvs: 0981815F2F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(71364002)(24454002)(189002)(199003)(377454003)(19580405001)(19580395003)(82746002)(10400500002)(189998001)(81166006)(81156014)(36756003)(76176999)(50986999)(83506001)(54356999)(5002640100001)(101416001)(7736002)(8676002)(66066001)(122556002)(11100500001)(3280700002)(92566002)(99286002)(87936001)(3660700001)(97736004)(86362001)(7846002)(4001350100001)(83716003)(33656002)(68736007)(2906002)(77096005)(106356001)(93886004)(4326007)(110136002)(102836003)(3846002)(105586002)(6116002)(106116001)(586003)(8936002)(2900100001)(2950100001)(104396002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR02MB2018;H:BL2PR02MB2020.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <1A5BA9262FF17B48B19F8DC2890381D6@namprd02.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jun 2016 14:57:05.8869 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR02MB2018 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u5MEvJtb010601 On 6/22/16, 5:28 PM, "Ulf Hansson" wrote: >On 22 June 2016 at 16:20, Alex Lemberg wrote: >> >> >> On 6/22/16, 1:21 PM, "Ulf Hansson" wrote: >> >>>On 13 June 2016 at 14:25, Adrian Hunter wrote: >>>> On 13/06/16 11:58, Shawn Lin wrote: >>>>> 在 2016/6/13 16:17, Adrian Hunter 写道: >>>>>> On 13/06/16 10:48, Shawn Lin wrote: >>>>>>> On 2016/6/13 14:29, Adrian Hunter wrote: >>>>>>>> On 06/06/16 06:07, Shawn Lin wrote: >>>>>>>>> JEDEC eMMC v5.1 introduce an autonomously initiated method >>>>>>>>> for background operations. >>>>>>>>> >>>>>>>>> Host that wants to enable the device to perform background >>>>>>>>> operations during device idle time, should signal the device >>>>>>>>> by setting AUTO_EN in BKOPS_EN field EXT_CSD[163] to 1b. When >>>>>>>>> this bit is set, the device may start or stop background operations >>>>>>>>> whenever it sees fit, without any notification to the host. >>>>>>>>> >>>>>>>>> When AUTO_EN bit is set, the host should keep the device power >>>>>>>>> active. The host may set or clear this bit at any time based on >>>>>>>>> its power constraints or other considerations. >>>>>>>>> >>>>>>>>> Currently the manual bkops is only be used under the async req >>>>>>>>> circumstances and it's a bit complicated to be controlled as the >>>>>>>>> perfect method is that we should do some idle monitor just as rpm >>>>>>>>> and send HPI each time if receiving rd/wr req. But it will impact >>>>>>>>> performance significantly, especially for random iops since the >>>>>>>>> weight of executing HPI against r/w small piece of LBAs is >>>>>>>>> nonnegligible. >>>>>>>>> >>>>>>>>> So we now prefer to select the auto one unconditionally if supported >>>>>>>>> which makes it as simple as possible. It should really good enough >>>>>>>>> for devices to manage its internal policy for bkops rather than the >>>>>>>>> host, which makes us believe that we could achieve the best >>>>>>>>> performance for all the devices implementing auto bkops and the only >>>>>>>>> thing we should do is to disable it when cutting off the power. >>>>>>>> >>>>>>>> Do you know if there is really a requirement to do that? >>>>>>> >>>>>>> Even without bkops enable, no matter for manual or auto one, FTL should >>>>>>> always do bkops like GC internally when needed to guarantee the >>>>>>> performance and balance the wear leveling. What I thought to do is to >>>>>>> make it more explicitly. >>>>>>> >>>>>>> Because then, what >>>>>>>> is the point of power off notification? >>>>>>> >>>>>>> When power off notification is sent, bkops will be stopped >>>>>>> in _mmc_suspend. So I don't undertand your point here? >>>>>> >>>>>> I am trying to understand why we need to do anything for auto bkops. >>>>>> Since AUTO_EN is persistent, we can leave the decision whether to turn it on >>>>>> to whomever provisions the device. Then we just leave it alone. >>>>>> >>>>> >>>>> Hrm.. >>>>> >>>>> one possible way is to control it by mmc-utils on >>>>> user space? So we should add a cmd for mmc-utils >>>>> there? >>>> >>>> That would be consistent with manual bkops. >>>> >>> >> >From my first impression I agree, as that is the policy we have been >>>sticking to when writing to persistent EXT_CSD registers. >>>Although, in this case, I am actually wondering on what is the best approach. >>> >>>Is there really ever a case when we don't want auto BKOPS to be default enabled? >>>I think BKOPS is a fundamental feature of an FTL and I can't see a >>>reason to why we need to involve mmc-utils/userspace to enable it. Am >>>I wrong? >> >> The even worst case is – involve mmc-utils/userspace to DISABLE it. >> I think this register need to be set by vendor and no need to be changed on runtime. > >If it is set by the Vendor, that's of course the best. It can be set by Storage Vendor. According to the spec, the default value of this bit is vendor specific. > >Are you saying that we shouldn't enable it during the card init >sequence from the kernel, in case it is disabled? No. By the spec – a Host that wants to enable the device to perform background operations during device idle time, should signal the device by setting AUTO_EN in BKOPS_EN field [EXT_CSD byte 163] to 1b. > >Kind regards >Uffe