From patchwork Thu Aug 16 11:34:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matias Bjorling X-Patchwork-Id: 10567331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E8DA109C for ; Thu, 16 Aug 2018 11:34:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6B5E2AC2A for ; Thu, 16 Aug 2018 11:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D78A42AC32; Thu, 16 Aug 2018 11:34:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DBC92AC2A for ; Thu, 16 Aug 2018 11:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391230AbeHPOca (ORCPT ); Thu, 16 Aug 2018 10:32:30 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:39012 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391193AbeHPOca (ORCPT ); Thu, 16 Aug 2018 10:32:30 -0400 Received: by mail-pl0-f66.google.com with SMTP id w14-v6so1967745plp.6 for ; Thu, 16 Aug 2018 04:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Subax9Rmkay8BJ9objlFfmUWJgRdRhAIQcj91vI4W/c=; b=CN8sbb0/daU5vY0+CmBCEWBN4st0EIst8kpnn5C4KVRGTWWYil4MEBTnIhjCT2T2Ib KtzjOLZjJAsvRdi7bpCaHkwTmnRxBt4IgOwgYCyo3TK25/iBvr+rsuFLHIiRhs0WL921 muk4Sr0x1ASJz17jtmEO1kK3sF6ANE0NL/1TlMogXS/OisYCF1NpXJuQyb9JDwOz3Jw7 2g6WgaqQ7AzbzrnMigK28tKIYGrUIibKXgSPLCYZu0kCz3GX7rGVsQY9aYYD3aYFRpxZ Eft2ar0qsV8FxqUM8GBqfoKDKu5Wds/Sgq+U3tAhOibIs8QrpuJudXt/LVm+JsSa+s71 BNOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Subax9Rmkay8BJ9objlFfmUWJgRdRhAIQcj91vI4W/c=; b=QtK2UEnkZhrycaZ9F4dC2Srfydv8t94wymaFPLrbTQ4YgHkldV3l5aeHH6MQaB41hg cVblov6PLjZMaqvFoyvzIzz6Fgs3Fj64Q+0pCHJaywjlBqLGaNgPreUvO59wtLnK1S0X m63GmGTG3MnrwhbNjO7wpL1TJLBym9EoCMl5o1S5j3yWmvfaStzFdqTVAizDcS5dEral 2nwVS24PG0UKDWftJHAgJ0RUiXgKvSRnisydHp3fCHtZ1sN5iUoLAlrKPRGxT1BdODwr Oa2MlT4su5zRk1NdEYfyanGfYFEzQTH3Y+YcjUZSkOsJz7NbI5UPBsdumwk59Ll7lMCk XqpQ== X-Gm-Message-State: AOUpUlGeqiVRugaN01JSsyPq8B5bLaMhVakFr++PvLHKlCRNFEr6bTr5 EWwHGBUCGMG3kyrfNMvj+YT6/Q== X-Google-Smtp-Source: AA+uWPz3x3q3NJZDjqJFDMQL0SqQ2s3UrQrdGVuUK9j/3Y7elAOgthbtRmlwm32es8nCIhyGgC43Cw== X-Received: by 2002:a17:902:3e3:: with SMTP id d90-v6mr28577027pld.12.1534419271803; Thu, 16 Aug 2018 04:34:31 -0700 (PDT) Received: from skyninja.hgst.com (rap-us.hgst.com. [199.255.44.250]) by smtp.gmail.com with ESMTPSA id d12-v6sm30022530pfn.118.2018.08.16.04.34.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 04:34:30 -0700 (PDT) From: =?utf-8?q?Matias_Bj=C3=B8rling?= To: igor.j.konopko@intel.com, marcin.dziegielewski@intel.com, javier@cnexlabs.com, hans.holmberg@cnexlabs.com, hlitz@ucsc.edu, youngtack.jin@circuitblvd.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Mat?= =?utf-8?q?ias_Bj=C3=B8rling?= Subject: [RFC PATCH v2 0/1] lightnvm: move bad block and chunk state logic to core Date: Thu, 16 Aug 2018 13:34:16 +0200 Message-Id: <20180816113417.3641-1-mb@lightnvm.io> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch moves the 1.2 and 2.0 block/chunk metadata retrieval to core. Hi Javier, I did not end up using your patch. I had misunderstood what was implemented. Instead I implemented the detection of the each chunk by first sensing the first page, then the last page, and if the chunk is sensed as open, a per page scan will be executed to update the write pointer appropriately. Note that one needs a real drive to test the implementation. The 1.2 qemu implementation is lacking. I did update it a bit, such that it defaults to all blocks being free. It can be picked up in the ocssd qemu repository. Changes since v1: - Add sensing of chunks wrt to free/open/closed - Add update of write pointer if chunk state is open Matias Bjørling (1): lightnvm: move bad block and chunk state logic to core drivers/lightnvm/core.c | 310 +++++++++++++++++++++++++++++++++++-------- drivers/lightnvm/pblk-core.c | 6 +- drivers/lightnvm/pblk-init.c | 116 +--------------- drivers/lightnvm/pblk.h | 2 +- drivers/nvme/host/lightnvm.c | 4 +- include/linux/lightnvm.h | 15 +-- 6 files changed, 266 insertions(+), 187 deletions(-)