Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3477627imu; Fri, 30 Nov 2018 00:36:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/VDJU2fJ1XfKKrOTB8vTF4+p32UR2ih+I4Pey5NHYVkAdegum+NzHm7mye3rUv6WxucHZsp X-Received: by 2002:a63:334a:: with SMTP id z71mr4124645pgz.400.1543567018772; Fri, 30 Nov 2018 00:36:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543567018; cv=none; d=google.com; s=arc-20160816; b=VtYsT5/ZsYh8Xu0oEGFYLx1EJm21vwdr0fz8WPFU0uk9Nkj7vvwlghGZF0vo9mGR8f 6Wgat9ltvE5HdZwoQjDtbeggLOSMChDaTSLaQ4qKucti9foegcdtfCwe5nP1znnNAs8j Tb12k5XlftqchDahRLbURFCA+XCM5A07V4C56Bo4dp8WZZH5TNBp6Zj0INq4huTNnK0j RNlvWrU3vXIzTDRWWR0uhKPvvaKpQJmYM2KdVUTIssF8gKqz2S95F/HZaR+UPLwun/kN yPZN61qHRjMTfUcfe6vPELWhUXKXa6B/nB6DWcViuXwGG1gt8ohffEo+CjgFs2bH6JWG TrFw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=mCARxxw98yN9PqVmOMrDcW5gJ9a4Nl9C3uk8omMruKk=; b=X70KwBuQkwG0ir1UOD8qjuCVdwEvXVLbkurqIxT8SWBqtAzPT2yXDT5p/XDSYezhEL dbbPN/qur+/wiLj+amAEJ8jYVJ/LCTL+E3c0tIPiH7iBIZG0id0JWL3F5B6oTDIxQO6+ GhUOy4K8lv30CqpUxAi1OBuu//Jy/twVhod5kGMHl4WYSsXRWsb/bL8M3FQE+ZoO+0hh MzugespD5I21VUu92IY+5uOcm37XH/SEOmvegOevkRSkP9VgQYhAfJxT6u5qBNzBL3j+ /PehSY3aFpYqzjqqft7uMftb7ydYeIAgeVRAdBvYSIJfw6InM1IcPfrmNBsJ63vH/jjk Swrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=EdfRr3Dj; 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 f18si4075191pgl.457.2018.11.30.00.36.43; Fri, 30 Nov 2018 00:36:58 -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=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=EdfRr3Dj; 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 S1726987AbeK3Tog (ORCPT + 99 others); Fri, 30 Nov 2018 14:44:36 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35470 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726572AbeK3Tog (ORCPT ); Fri, 30 Nov 2018 14:44:36 -0500 Received: by mail-lj1-f194.google.com with SMTP id x85-v6so4256111ljb.2 for ; Fri, 30 Nov 2018 00:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mCARxxw98yN9PqVmOMrDcW5gJ9a4Nl9C3uk8omMruKk=; b=EdfRr3DjPyED+LRv3c0LQqpxHwE2Kf4kJKZ2CgH8SejPNIEtDgDokY9O0B5/9YhZCX oSG5sLRZbQ29D0QVb5R1gbWHYmEl95BbpivsRkIW8G2FWhaKL3+baTu0KA4QENALkqTT gv/374lpSF8cqfQPQJPc/cgIACNNNmHkWWdOd6TlhPleXh58C9HwPAUrnfyVeWZ+u7rG 9auEFRML4LEEKurnC4Uv8Zgg9IRoxGoCYnDMx7S+JlYYxbj4X+zketEUgE8YaFjbSoTw K+6ZOTEwYyZFGnHl5sJDm7k87DlRfjytLZwJDq5kY1UyPDf8vVABBCJZKC0WmOQmjRIn HTpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mCARxxw98yN9PqVmOMrDcW5gJ9a4Nl9C3uk8omMruKk=; b=bB+pYc/ZQIucImkr0ym/Al6DjQvn7jKKtVC3H+dF2p9PX66jhFWJMQZoymY/9Dt6uX dQ2eVN59hI32dHraJUkX3fOQBUlYzy5ukI3zhCrt+zAUalaxtWj1zhaxuWzm9ub1KEZf JCEfooaXrOk5gB+c5dnb8oEUO+7/evx/et+TKT0xfLZKtgGI1t6AuWD2RvCDq8Cz02VO u9kZQB9rdwKIavQ0Q04MFutr3RI4ACfhg3XiOBu0KujjFP6BNg5gTLlhZlB3Voe4EqaW HIGtEShWqEDt90NQc5355sSVJLymD0WtTyWdlwP/Dt4v2W3ACbT7APaAW3NrA+bwLj1r JQEw== X-Gm-Message-State: AA+aEWZGQmF8l4IcvTP6NTwp0srdNCdhRYueyO20FLA4+rZREze6uowE HcWpCdkwwIqQCJ6Z3CSfaqZp3A== X-Received: by 2002:a2e:974a:: with SMTP id f10-v6mr3656795ljj.61.1543566962120; Fri, 30 Nov 2018 00:36:02 -0800 (PST) Received: from [192.168.0.36] (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.googlemail.com with ESMTPSA id v5-v6sm678716lje.78.2018.11.30.00.36.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 00:36:01 -0800 (PST) Subject: Re: [PATCH] lightnvm: pblk: add comments wrt locking in recovery path To: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= References: <1543404016-14902-1-git-send-email-javier@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <55c31953-4816-c53a-72bf-1d159007378c@lightnvm.io> Date: Fri, 30 Nov 2018 09:36:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1543404016-14902-1-git-send-email-javier@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28/2018 12:20 PM, Javier González wrote: > 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" > Picked up for 4.21.