Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1018008imu; Wed, 28 Nov 2018 03:22:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/WJ353pI5cWEs3KPph8CZbFYsEba2Q4jMElwDsONh61FZCtUbkDVgK8nOPD6nukE+8dWSQx X-Received: by 2002:a17:902:7b91:: with SMTP id w17mr36687983pll.111.1543404176702; Wed, 28 Nov 2018 03:22:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543404176; cv=none; d=google.com; s=arc-20160816; b=EwLLc/QjZaEESzReIzVPPskfxywxu1OTrSO2KxfvNTfvPQ/VMpxzPx0+lQvkXJlls2 LYP56SKbXx6gkAwpNkwU+O5AouVfLcyrTnTUJD1A5D+TA7pxo79q7NW6y1V/jWnvRNnW Puu9qjACQNxJQGJzctL6S5wzYP2JMXyORueWrAAb4CuwfuQOAtxxRkKYlyb3czgRjS4K 2nXnDVXVI0DQAVqmxETiQ5MkgPocPG4bw1qDf29OVtWXxjNcNqZPsaHfVEHafaTAAUAA qCD8plYeQ/6+ED6ar7y63YjVzUG8pmQOrtnQf9C4raxvP766qve7AqPPYxJHmYD+ytMD zT6Q== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zwp4X6Ypxw1nnLLxi/i3YFFpGyOD035ZsmbDeY8aCZc=; b=G+VkJXry3rQQ8/zoLnNXGHqG1rvj4Hp4k4cSQL65b9EWYDTNJ+OrLbHBQ5m6PYb0jP SZ3SjwN1piauTQw6nAYrVo6+Dg90mYrnoTqzx1arvJmDC4wEIkQZG9fW3ojZC74yYZwS B88PAH5/jZUJPVxCH/2zzD0LgUJkrhgdQa8a3tYjWV0085zp+PpZz9uDaVjrxgKTvvv5 tQeKwPaFpMAYyED7I9lqrVqkPDLenud+VLon2bIyRNuWxJTjps66YrHoFN6Ys3bOhmGL zzfoZXQajYOn4cFq4V1yTGXuuwmt/vKhL86HnbRv+hesJslKSi/IRmiPUO25F84IIxe7 m58w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b="17KDu/J0"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f35si7182794plh.399.2018.11.28.03.22.41; Wed, 28 Nov 2018 03:22:56 -0800 (PST) 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=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b="17KDu/J0"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728102AbeK1WVo (ORCPT + 99 others); Wed, 28 Nov 2018 17:21:44 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33699 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728000AbeK1WVo (ORCPT ); Wed, 28 Nov 2018 17:21:44 -0500 Received: by mail-ed1-f66.google.com with SMTP id r27so21778513eda.0 for ; Wed, 28 Nov 2018 03:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=javigon-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zwp4X6Ypxw1nnLLxi/i3YFFpGyOD035ZsmbDeY8aCZc=; b=17KDu/J0u0hJoBMRI3TTWUW4C9LbCaRuP7V4FpoWiq1ZFU5/UVasRgH5Hkp0I/NCyC pkmC1QgIyIOEkKRE/PW+HL+GSpuAjtGP9PCiHqHHqqKTFel85nRL+IjXjFHNuzX1jFES JuCeDLQl2hWBqKxJAxqpS0WdQ6CI2H7sYdo434+8f/3Zh1Fn0VFrE/9l6CkvFbL5yfyR a7BD+ClixoBTwmTziDu0G01aj7xH2E4kFy2KnZ1+BaTQHpW9NGIHRgslIqaDFfSECXYj EUgpvQUpUkXMBoftDn+ZTWP9j+zFoY+YFRTTAe15ybTse+CdiCq1+oesfwA3eDR3u/hf m0Ug== 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=zwp4X6Ypxw1nnLLxi/i3YFFpGyOD035ZsmbDeY8aCZc=; b=nkfIFwbHptD4ndTUZaQDclTIao0x6nncdEVMIeUR2PSTTDiFFQrBIEhCa7utvzkfzc tX2V6Q68KV9nycKOa5ay/T9t2w2gJxI/mjvj5csz1jw0gi1d5Qm1lnY7ca3GWHUdhG08 UaOJs2h/s1PIJ5sDbgWyDOVLvf9XqYPStwUuW6BFPXkSwA3eTXMTip+MtiCpncdkbYZo iRczVPYfn79iFaiKH2YJ6fUiNRKQ3ugqZfKbRIsLD1lNg5GPv+E7jeORVbX/ccrs23k1 3RMfIRLvu7G2yZrqcs5zjTV09ZmC57s09yZtoMqggd05y04ezI35274Xl7m+/1lnL7b5 DQfQ== X-Gm-Message-State: AA+aEWaaDHzYaiXEuvRBpgSzFGnAvRN24cQuMLqrGckG4VN8rEJtTi87 kFHjG03zkp9OwMLTiBmhkutgnJvNCJ0= X-Received: by 2002:a50:8ad6:: with SMTP id k22mr1546975edk.189.1543404024643; Wed, 28 Nov 2018 03:20:24 -0800 (PST) Received: from ch-wrk-javier.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id z39sm1765504edb.81.2018.11.28.03.20.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Nov 2018 03:20:24 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH] lightnvm: pblk: add comments wrt locking in recovery path Date: Wed, 28 Nov 2018 12:20:16 +0100 Message-Id: <1543404016-14902-1-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pblk's recovery path is single threaded and therefore a number of assumptions regarding concurrency can be made. To avoid confusion, make this explicit with a couple of comments in the code. Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 1 + drivers/lightnvm/pblk-recovery.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index 44c5dc046912..f1b411e7c7c9 100644 --- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -1276,6 +1276,7 @@ static int pblk_line_prepare(struct pblk *pblk, struct pblk_line *line) return 0; } +/* Line allocations in the recovery path are always single threaded */ int pblk_line_recov_alloc(struct pblk *pblk, struct pblk_line *line) { struct pblk_line_mgmt *l_mg = &pblk->l_mg; diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c index 416d9840544b..4c726506a831 100644 --- a/drivers/lightnvm/pblk-recovery.c +++ b/drivers/lightnvm/pblk-recovery.c @@ -13,6 +13,9 @@ * General Public License for more details. * * pblk-recovery.c - pblk's recovery path + * + * The L2P recovery path is single threaded as the L2P table is updated in order + * following the line sequence ID. */ #include "pblk.h" -- 2.7.4