Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp831056yba; Fri, 26 Apr 2019 09:25:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfZ7fk4g8lLWj756gzoSpCoy3IYXuy4oPSiHscZ6lwdhx/jH9jtM8LBVfn5n0u7ti/etqX X-Received: by 2002:a62:4d44:: with SMTP id a65mr9040408pfb.150.1556295936139; Fri, 26 Apr 2019 09:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556295936; cv=none; d=google.com; s=arc-20160816; b=j/2I6MQcmiUtuizklSITeZ7AU/Iq+HcnzFeRKxl8JXd+EK8w9p7qX/DLasSq7WljWS gBEDLT3UCXs7dAbSr0C4JOdHlJYT4ZAXjqw3fAqDKUEd1stBRjMy/mY1KjmF+AAntdm5 VR0n8TzuMPDLHEcF9rLoezhgNWuKSpbvlcdZASHY/12drKcs9AI/W0CpAZ4auIZS2VPB Z2Kxff5RED374mpdSiEP5VjfHMwD/nU2wkuLDaVOnT8M/pBzNX5NCMKyNBGYK56ODeIv 1us1Ac0Nko9TO8qL+E+OGt73gLVnMLyLu2ZQ2jjANsVbkz/CWHvOAUiTPmsOxdPvubSO cXEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=UzhCyWVw2ohKAqlWgQxAK1pFWZImjiKlk+1POr4aVyE=; b=qul2LWa6CdZQodLkDxCE17a6dJuhDohJxjWJvRmkRvHClxP1MS97BIhQ4zaPPayh+W z45DO8jXQCpdUKO9DF3lT9zWW8k+0ofAaOTK2WFwyTcWyuaOH4NBNH2ySk92QAx4Uiat plwt8Uaf/LquHWwFJLlv7kY+2NzerfffG2a7CAnHnC+ii/covnYJvwcgCUMcFG6vTTvM wRghFUU8el4N+feOR6KMVGdNQCn7q9v8WEEbSZ/KUzvJ+rCNyEKfX9HG3oOj1shEYEJv 4t4uudKAjnx2lvMoMNFk9DDqwntcZNbr9A44+2pdla82kvQ98gH/0vI+S6dlVVohDAF8 vmeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ucsc.edu header.s=ucsc-google-2018 header.b=rYfvjc8p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ucsc.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si24280607pga.205.2019.04.26.09.25.20; Fri, 26 Apr 2019 09:25:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ucsc.edu header.s=ucsc-google-2018 header.b=rYfvjc8p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ucsc.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726262AbfDZQYJ (ORCPT + 99 others); Fri, 26 Apr 2019 12:24:09 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:32875 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbfDZQYJ (ORCPT ); Fri, 26 Apr 2019 12:24:09 -0400 Received: by mail-wr1-f67.google.com with SMTP id s18so5284886wrp.0 for ; Fri, 26 Apr 2019 09:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsc.edu; s=ucsc-google-2018; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UzhCyWVw2ohKAqlWgQxAK1pFWZImjiKlk+1POr4aVyE=; b=rYfvjc8pDeEnoXFyh0FcY5gFVGfdHYxr43H7Taz7k/21srXuCPCjn6AQvrCWRCqdKW xgZFeh9Hchpzd2GZI3xJV6WMPE6ceyLTeQD+sSM/jz4EoOCZIvNnp+7LobYp2BhWja9F EsMF9rwYelFUBEblVkBrWNDhhaIxvlUZeCYuQGUS0nDtfTzup0r+H6CIpcxkw6S4X18Y hAUY0KowaDPkmZgIEJWpwZ1Y2jRY5iJk8lKOBh/FOxmEuU0Us6/40qBuANgrd7UaOeok reClcFDGKBAgIAIWCO3zMTr7x+pHHWgkN0A/OUuTZ1E9Ji0R5HN8Xm5dJ5QNE1VCDfj3 1Brg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UzhCyWVw2ohKAqlWgQxAK1pFWZImjiKlk+1POr4aVyE=; b=tqSACbrytCo+TaTDjpyhY16V/WmTBmMfKAyGOXPg76zsz03NbKT71YWvld/SvrWRms bRErigaFasgjNw0ot64cB7WsWR/meYRHlJ0uIjHwRbkOYYSpoZmoevrGcR88i/ghu9MZ htfnd25iF+JNMiiXsjR5ZtGJqwd+ds1cyaGPHsb+giJhGM3UftjOXGJNHvPkFcoILbo8 2CxH28vhPe/kZ3O5+Wkn1HXK/vwYt7aitPbcXB7LaZ23zcg3fk5WhqxiZGHuo9FjLmQO g8D26b6orrocTIorsXMGsm8FPg8WviDI2kK37oiX+gLewSbX7071zWJ3KRiaVHCQ4Qno 4S9w== X-Gm-Message-State: APjAAAVLOoanZgG5q0pEEDjqgmh4auu9bwc215JMjSi5fQWr9pJibiHr bsAxevjSPYRF05FxR7+O+sgWjQTrPi03hvAiAPBWXQ== X-Received: by 2002:a5d:4e92:: with SMTP id e18mr249636wru.302.1556295847150; Fri, 26 Apr 2019 09:24:07 -0700 (PDT) MIME-Version: 1.0 References: <20190425052152.6571-1-hlitz@ucsc.edu> <66434cc7-2bac-dd10-6edc-4560e6a0f89f@intel.com> In-Reply-To: From: Heiner Litz Date: Fri, 26 Apr 2019 09:23:55 -0700 Message-ID: Subject: Re: [PATCH] lightnvm: pblk: Introduce hot-cold data separation To: Igor Konopko Cc: =?UTF-8?Q?Javier_Gonz=C3=A1lez?= , Heiner Litz , =?UTF-8?Q?Matias_Bj=C3=B8rling?= , Hans Holmberg , linux-block@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nice catch Igor, I hadn't thought of that. Nevertheless, here is what I think: In the absence of a flush we don't need to enforce ordering so we don't care about recovering the older gc'ed write. If we completed a flush after the user write, we should have already invalidated the gc mapping and hence will not recover it. Let me know if I am missing something. On Fri, Apr 26, 2019 at 6:46 AM Igor Konopko wro= te: > > > > On 26.04.2019 12:04, Javier Gonz=C3=A1lez wrote: > > > >> On 26 Apr 2019, at 11.11, Igor Konopko wrot= e: > >> > >> On 25.04.2019 07:21, Heiner Litz wrote: > >>> Introduce the capability to manage multiple open lines. Maintain one = line > >>> for user writes (hot) and a second line for gc writes (cold). As user= and > >>> gc writes still utilize a shared ring buffer, in rare cases a multi-s= ector > >>> write will contain both gc and user data. This is acceptable, as on a > >>> tested SSD with minimum write size of 64KB, less than 1% of all write= s > >>> contain both hot and cold sectors. > >> > >> Hi Heiner > >> > >> Generally I really like this changes, I was thinking about sth similar= since a while, so it is very good to see that patch. > >> > >> I have a one question related to this patch, since it is not very clea= r for me - how you ensure the data integrity in following scenarios: > >> -we have open line X for user data and line Y for GC > >> -GC writes LBA=3DN to line Y > >> -user writes LBA=3DN to line X > >> -we have power failure when both line X and Y were not written complet= ely > >> -during pblk creation we are executing OOB metadata recovery > >> And here is the question, how we distinguish whether LBA=3DN from line= Y or LBA=3DN from line X is the valid one? > >> Line X and Y might have seq_id either descending or ascending - this w= ould create two possible scenarios too. > >> > >> Thanks > >> Igor > >> > > > > You are right, I think this is possible in the current implementation. > > > > We need an extra constrain so that we only GC lines above the GC line > > ID. This way, when we order lines on recovery, we can guarantee > > consistency. This means potentially that we would need several open > > lines for GC to avoid padding in case this constrain forces to choose a > > line with an ID higher than the GC line ID. > > > > What do you think? > > I'm not sure yet about your approach, I need to think and analyze this a > little more. > > I also believe that probably we need to ensure that current user data > line seq_id is always above the current GC line seq_id or sth like that. > We cannot also then GC any data from the lines which are still open, but > I believe that this is a case even right now. > > > > > Thanks, > > Javier > >