Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3047755imm; Mon, 13 Aug 2018 05:13:14 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx7EqZMSdCJz2L/TNWTGK95Hw+2c+e4XwtCuiTLmm9tcASOkOnPT9k+S77X24sQJKFwJP+z X-Received: by 2002:a62:ea05:: with SMTP id t5-v6mr18732071pfh.228.1534162394747; Mon, 13 Aug 2018 05:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534162394; cv=none; d=google.com; s=arc-20160816; b=ojyVXY3BoTnc3oyUwh2igqDc7pHuj5aNoRfETvAieX+OEhbXIP+lzoHMdHEo2Fq8f6 yY7RRqIuNpyt5PpZ2YuolNGSzvnN4X60kpVYXMMQ18BKeGEz3TkWWkPlgqWtc8Z3aIfW LOC7cJUFYyH5MR3+YZlNf2pIMskVbTqW3V2lz25zkj0bopjBWYP1i35EHcoovjlpO1eG vl7PQpL/mcW97RQJML+jqkn18pe+uMBa8gCK4tfloSwRWQaipZGFxvSwGUaOuD3/KEYp dclJ3ZXHwdgh5vz8IXV8jSU7iC5G/GajuXg2GOP6DRbTWr4bRhdsv+S9ZwmQpuAXoYwA xP9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:to:cc:in-reply-to:date:subject :mime-version:message-id:from:dkim-signature :arc-authentication-results; bh=fdwuIoPicO1bGLVAUl+Pe5nZ/IJbxbWNu/xXePeBeKI=; b=vKv4yq7AWX7xiiDOXj3VdFjZrA7UnMVjnJ/lcgQhqD+PCbuouQeXQaQR47VuJ8SncN ztdcx8sqN5MgpqylR4dhcvUrNwp5M2cShn0HIzhPs9G10/ZPRjex5pkPSZ2xcfpA+jsI F53To5+TelCgzU/jVT8mPOd9x54bE4i4IuXB/AuL5eaa78opCvm8ihPQ5tWiMysXCtcd F3UADGyi0iTS3Bu6tpD/kWocIO2+0CKcHNhHatKJ3JJZMC9gdVWqNI8jVYdBAj95njZk sNB9xLKS1am26rI0p1Lxv+Tn+7/7GAjuehuCrMsj/ZSLmSWIz8+AP/lTqgR+6LdnBfwA x5dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=HGmDXKul; 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 a16-v6si17342675pga.168.2018.08.13.05.12.59; Mon, 13 Aug 2018 05:13:14 -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=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=HGmDXKul; 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 S1729651AbeHMOyL (ORCPT + 99 others); Mon, 13 Aug 2018 10:54:11 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:42701 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729084AbeHMOyL (ORCPT ); Mon, 13 Aug 2018 10:54:11 -0400 Received: by mail-ed1-f68.google.com with SMTP id r4-v6so8110391edp.9 for ; Mon, 13 Aug 2018 05:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=javigon-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=fdwuIoPicO1bGLVAUl+Pe5nZ/IJbxbWNu/xXePeBeKI=; b=HGmDXKulLTxApvWEd3jOEF8G76AlkNutNE/qMf3u5ik1ySFvxSPr6W0cb6nxYiVS/Y 2Cd1HVO30Qch2FEaB3nVuakgo+SH5tp9Dx3hoPD8rU0TBU3GwVSSHTiEbQgbn7Fde0jI WlUE1CcXQ0RvRJRwkO7WD9qQ4xPMCgyUnkqcpzu1dksJg1DMAFqGwKtS/oJIUPltjlTr rXd7MECacx196vcg62oCr/ZilDOx2Ciy/bLmM6lUqesC39xNfF1d4OPwKDSEqcU3dB1x s8PQnEbYaML0ySH25YanMhxBJ+7N10QKE4G2RQiV+XyeDqkdiRLl5I4JwgqjuR3t0+/Q cAjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=fdwuIoPicO1bGLVAUl+Pe5nZ/IJbxbWNu/xXePeBeKI=; b=aSHCSdLrdUGQ+JFzsQFlqcyjitxizyBIYaOxQy5FbAQIU3j923BDtHmlwDFnSnNt9B bjDaqtDb6wd4SG0IpAci2Pvv+uVlc3o7aBHHtAfqviHTahOay7UN86sYysg0qwg/H59Q sEv/QYVmH31h6LDNf0y/kwm/7JFNiZM/0+jJNI01HcXkxW5yX/57QLRx+fl8RAGf46uq bot5+xjxwv6suDYkAVqXbVxP5cIPMYO29YRcdS28SwYzDdIuA/3r8IUMI5Qxxo2NdCp4 EirvSY+XEhnRBg8TvYg8yvHoZNwsBOHfu8zYBI5DxjXH/liuATEuFa1qm/VZv+MzErYo B3GA== X-Gm-Message-State: AOUpUlE7h+DYf1qK/SiIyvINv8lYGzl3or1RVQUtNLE7SoBbrmD0ZCMn uX+7/tlsVOfpC/vEtupklooNaQGTzXA= X-Received: by 2002:a50:9226:: with SMTP id i35-v6mr21682729eda.27.1534162328957; Mon, 13 Aug 2018 05:12:08 -0700 (PDT) Received: from mac-halley13.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id x7-v6sm15768732edm.23.2018.08.13.05.12.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 05:12:07 -0700 (PDT) From: =?utf-8?Q?Javier_Gonz=C3=A1lez?= Message-Id: <61F640FB-E38C-41CE-B95A-D2CDAA0008EF@javigon.com> Content-Type: multipart/signed; boundary="Apple-Mail=_0C412472-56DD-42A0-87DE-E5A812CD2C81"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [PATCH] lightnvm: pblk: take write semaphore on metadata Date: Mon, 13 Aug 2018 14:12:04 +0200 In-Reply-To: Cc: =?utf-8?Q?Matias_Bj=C3=B8rling?= , linux-block@vger.kernel.org, Linux Kernel Mailing List To: Hans Holmberg References: <1533297919-27253-1-git-send-email-javier@cnexlabs.com> X-Mailer: Apple Mail (2.3445.9.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_0C412472-56DD-42A0-87DE-E5A812CD2C81 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 10 Aug 2018, at 10.04, Hans Holmberg = wrote: >=20 > On Fri, Aug 3, 2018 at 2:05 PM, Javier Gonz=C3=A1lez = wrote: >> pblk guarantees write ordering at a chunk level through a per open = chunk >> semaphore. At this point, since we only have an open I/O stream for = both >> user and GC data, the semaphore is per parallel unit. >>=20 >> Since metadata I/O is synchronous, the semaphore is not needed as >> ordering is guaranteed. However, if the metadata scheme changes or >> multiple streams are open, this guarantee might not be preserved. >>=20 >> This patch makes sure that all writes go through the semaphore, even = for >> synchronous I/O. This is consistent with pblk's write I/O model. It = also >> simplifies maintenance since changes in the metdatada scheme could = cause >> ordering issues. >>=20 >> Signed-off-by: Javier Gonz=C3=A1lez >> --- >> drivers/lightnvm/pblk-core.c | 14 ++++++++++++-- >> drivers/lightnvm/pblk.h | 1 + >> 2 files changed, 13 insertions(+), 2 deletions(-) >>=20 >> diff --git a/drivers/lightnvm/pblk-core.c = b/drivers/lightnvm/pblk-core.c >> index 00984b486fea..160b54d26bfa 100644 >> --- a/drivers/lightnvm/pblk-core.c >> +++ b/drivers/lightnvm/pblk-core.c >> @@ -493,6 +493,16 @@ int pblk_submit_io_sync(struct pblk *pblk, = struct nvm_rq *rqd) >> return nvm_submit_io_sync(dev, rqd); >> } >>=20 >> +int pblk_submit_io_sync_sem(struct pblk *pblk, struct nvm_rq *rqd) >> +{ >> + if (rqd->opcode !=3D NVM_OP_PWRITE) >> + pblk_submit_io_sync(pblk, rqd); >> + >> + pblk_down_page(pblk, rqd->ppa_list, rqd->nr_ppas); >=20 > This will only work if rqd->nr_ppas > 1, better check if rqd->nr_ppas > is 1 and pass &ppa->ppa_addr on to pblk_down_page when needed. For this particular case, we will always get > 1 ppas, but you're right, it is more robust to do the check for future cases. I'll add that to V3. Thanks! Javier --Apple-Mail=_0C412472-56DD-42A0-87DE-E5A812CD2C81 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEU1dMZpvMIkj0jATvPEYBfS0leOAFAltxdZQACgkQPEYBfS0l eODZnw//V7Q/gZ+s59nT4Wb4mt57BNSa81cogmG/6ge8L3ao+vFGLR0UN8udtAx9 cHUVTQpdtBLRlxQEYlOefMP7YYcWyH8vChO8Vg2eZHie0ivLpf3yfIv86Y7cgmSR dzkQwbJqrw11WDgDv0FacAQeGPfr7pODMxw7JX5OaxKUP2QHm/5cWflmqTyAt/Qs 1C2G3vguI+BufHu4oMQkw42MpKgMtCMe1IRrwnVzA37tNPuxQJ5h6LAe1heohbNk blCk0LEBVcwXUrKyawzR01Z5tIOpDS+Q7oDaV+MoMPS9fIBR2x1KlijIGIIeruc+ QRSKdxGPgaU7okbnMFJc1jgKHXPhUtyqLC3WwWjm7ebMS5qCGIjCmxwUoETR8T4I szaa4LYBZ3iojlDAK1Pyo0SVbd+LRaUI1y+KlylH0hXS6vvq5bUEVr5QAiJKPpVE i10XbMmVF/RiKxo4HZg84ipLifu15u61J29tJigcIadqG3Z3NIxwfVF4/cHczFCo z3uBZFXqp7e/JhDmCZc3iLx78Mr9U2da9WXfOYMtRnZem3VqEHvRwb68aMvFTnG9 av0H6oZ6ZjAKutNP4ET2ZGl647thxTqBkeR7IXsxfQTMhoVbETwOGH3EmYuc4lnM 5NpgJ2fM9/HXQZY7F+QsM+2P0BB+vFraFyQewF55xP5wpU4vvRw= =PtHW -----END PGP SIGNATURE----- --Apple-Mail=_0C412472-56DD-42A0-87DE-E5A812CD2C81--