Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754747AbdDJP4C (ORCPT ); Mon, 10 Apr 2017 11:56:02 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:18030 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbdDJPz6 (ORCPT ); Mon, 10 Apr 2017 11:55:58 -0400 X-IronPort-AV: E=Sophos;i="5.37,182,1488816000"; d="scan'208";a="111917107" From: Bart Van Assche To: "jg@lightnvm.io" CC: "mb@lightnvm.io" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" Subject: Re: [PATCH v3] lightnvm: physical block device (pblk) target Thread-Topic: [PATCH v3] lightnvm: physical block device (pblk) target Thread-Index: AQHSsKqN1Za0Hn/Syk2atMNQRkTzgKG8wjEAgAICSIA= Date: Mon, 10 Apr 2017 15:55:43 +0000 Message-ID: <1491839741.4199.7.camel@sandisk.com> References: <1491591015-7554-1-git-send-email-javier@cnexlabs.com> <1491591015-7554-2-git-send-email-javier@cnexlabs.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lightnvm.io; dkim=none (message not signed) header.d=none;lightnvm.io; dmarc=none action=none header.from=sandisk.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [63.163.107.100] x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1535;7:qAmXRRm+VIs1bBr+wokrDbnEBY5+k5h8Y5BHvL9JKFOIEbPXkWId3XQErvIWv8GPC6w2/Q6OizdffKjXOTrYJgP+IwGj/pqRIzyShmTgVvWOWks86jpGmZumeJN8Ru9fMlPByxTV3FhCRf+ZQGUYv06IDa+RMqNwhK/GoOwLEj1qXETDgDWkHjXECKu747tKtOK3WUL7Z+dlNvLHHfT6+beF3pra9SR9hPdFWrqRXtndYENkrRXV8Z7SWKbS0fb5YTqNrrderUP6P85KVEOTvd9HY6N643Uj11pDHuBEbB9YCAbZQoLnYkF65BWz8Ouorl3SALZrOn1d8njxp9KwKQ==;20:owy1ZTJWGvue9KSHJwpeocqHmLLpYouZvLd/FpBTFtauG1wTSDL4SJ/tFobHEpGEJemWFg1hvg6HQVw6ETZkejrG8xmKWw+hK4naIG5PZqsOoOi1geVDMGRo5yccp2AgzJwIiJXF2NXGdDFmGuvckMTDV2rdMFMnDJ1e0OdWLKY= x-ms-office365-filtering-correlation-id: 85e0add1-b398-427c-850c-08d4802a0b68 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:CY1PR0401MB1535; wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(42932892334569); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6072148);SRVR:CY1PR0401MB1535;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0401MB1535; x-forefront-prvs: 027367F73D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39410400002)(39400400002)(39850400002)(39840400002)(39860400002)(39450400003)(377424004)(24454002)(305945005)(8936002)(86362001)(6436002)(53936002)(2351001)(5640700003)(81166006)(6246003)(99286003)(7736002)(6116002)(76176999)(102836003)(6486002)(1730700003)(8676002)(77096006)(3846002)(36756003)(50986999)(54356999)(93886004)(54906002)(6506006)(6512007)(2501003)(189998001)(3660700001)(33646002)(66066001)(2950100002)(25786009)(6916009)(5660300001)(53546009)(2906002)(38730400002)(110136004)(122556002)(4326008)(3280700002)(103116003)(2900100001)(229853002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1535;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: <5E60CCC0CDB3904299AF6948EEB48842@namprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2017 15:55:43.2744 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1535 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 quoted-printable to 8bit by mail.home.local id v3AFuBao009394 Content-Length: 2186 Lines: 43 On Sun, 2017-04-09 at 11:15 +0200, Javier Gonz?lez wrote: > On 8 Apr 2017, at 22.56, Bart Van Assche wrote: > > On 04/07/17 11:50, Javier Gonz?lez wrote: > struct ppa_addr, which is the physical address format is not affected, > but pblk's internal L2P address representation (pblk_addr) is. You can > see that the type either represents struct ppa_addr or ppa_addr_32. How > would you define a type that can either be u64 or u32 with different bit > offsets at run-time? Note that address conversions to this type is in > the fast path and this format allows us to only use bit shifts. Selecting the appropriate representation at run-time would require to pass pblk_addr by reference instead of by value to any function that expects a pblk_addr. It would also require to have two versions of every data structure that depends on pblk_addr and to use casts to convert to the appropritate version. However, this approach is probably only worth to be implemented if it doesn't introduce too much additional complexity. > > > +#ifdef CONFIG_NVM_DEBUG > > > + atomic_add(nr_entries, &pblk->inflight_writes); > > > + atomic_add(nr_entries, &pblk->req_writes); > > > +#endif > > > > Has it been considered to use the "static key" feature such that > > consistency checks can be enabled at run-time instead of having to > > rebuild the kernel to enable CONFIG_NVM_DEBUG? > > I haven't considered it. I'll look into it. I would like to have this > counters and the corresponding sysfs entry only available on debug mode > since it allows us to have a good picture of the FTL state. If there are sysfs entries that depend on CONFIG_NVM_DEBUG then the static key mechanism is probably not a good alternative for CONFIG_NVM_DEBUG. > > Has it been considered to add support for keeping a subset of the L2P > > translation table in memory instead of keeping it in memory in its entirety? > > Yes. L2P caching is on our roadmap and will be included in the future. That's great. This will also help with reducing the time between discovery of a lightnvm device and the time at which I/O can start since the L2P table must be available before I/O can start. Bart.