Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1977434imu; Thu, 24 Jan 2019 05:20:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Jof2q5BjV273R2Z7wDWQcfH4S4jG45vS6hdRw95qcWcf0RZ3wDjdo6AYBwkjsGqzEzmQN X-Received: by 2002:a62:546:: with SMTP id 67mr6302661pff.99.1548336049784; Thu, 24 Jan 2019 05:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548336049; cv=none; d=google.com; s=arc-20160816; b=Zv66wplwFbcc4Ub76LzJGWGcGgfXr/uec72rY6xDgqpu5KLlOARRfppa6XgWAUv9K2 CaFYP0BVxGTw8+HogmTTS3hvG3vDQ2fWFUnJtdr4/W/n5FT35/qXACo9wqSzJaFAj7Dz GaGgIE9Nffzd8ORdz2UGuox21nEE2ZgulVOqYusW4q3Ar1U7JPZuCGuVX2lcyVB2SgSD ztYivw80PwnyOfdfMPKTkb5i2BqZfyMG4Vehlocj7L4Py0yW0eYHWf4Md+LhAPaPqpAr Gnmf818rdjP+6hjt+DP5+UIlJuq9XFKgX8shv2SnxHQvx90pH5WJqsoHugLMaxAPpAPU D0QA== 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; bh=qcC1rYfqoDq/mo5Jqc1k0GDYYCSCIlZEfEp1LZS+1xU=; b=DxzQ+yvNjufv81xJ1oac3dQxnd2g+JJLpPDkCPl+daUJtDxq5amHAtOJlyOKwX8s+Q nIOYk6OFjWr4uOpiwdOhXjkBaVx9FAk/kSwClrBrbg5mtFpPv5eEC76taYjgYnf1Rs6U eM0IeDgwZRl5lpYNDJ8t/91JjjJi1FXpsRUmQ0Hoi+x5IWgGFnIe6XRask9oH1EigZUQ c+eWEiYnvvnlYQuzrcPaVQt2vLjEfxizoZSKTaWUgUdmy5Vga3E38eLZId/J8dR0yrfX O0UTxvxZmnLAU0FcgOp3U/s/W+zamAcbczZnd4kvci/+DVdeoMXpmPuPgdAh1zOFVw0a 1Yyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@javigon-com.20150623.gappssmtp.com header.s=20150623 header.b=dgt4glVk; 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 c65si21575896pfa.148.2019.01.24.05.20.34; Thu, 24 Jan 2019 05:20:49 -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=dgt4glVk; 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 S1727902AbfAXNT4 (ORCPT + 99 others); Thu, 24 Jan 2019 08:19:56 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:32822 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfAXNT4 (ORCPT ); Thu, 24 Jan 2019 08:19:56 -0500 Received: by mail-ed1-f67.google.com with SMTP id p6so4577104eds.0 for ; Thu, 24 Jan 2019 05:19:54 -0800 (PST) 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=qcC1rYfqoDq/mo5Jqc1k0GDYYCSCIlZEfEp1LZS+1xU=; b=dgt4glVkJEQsu+eWop2bK+7ADLA+txesL9VfFOyDZaJ+rYGvsWpEuQTxxubxgKAIE8 LNHN9kfRvUFHVDEESyQarvnLGajKcKQTI1h25NpGR5/f8h+vke6zIUbbFfXBBWHY0rad bcydGuGMfvqoTAvpZiheDM/ykjqRiW+npaHDUNPv67PKlQL4gehAuJjPTH191c8oTlep SqTegPTEXiF75KUBrztaB7FiblvB+8W5p45sZaocYUJDtlwmPhQwSwNHMOM4htqxA+aN lVLro5KQclBvleQL49kqQGwop/m5aEjjzTIEe/KNV/kGgQHxJvG2NkKKoZyIkDqlJwJK UYoQ== 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=qcC1rYfqoDq/mo5Jqc1k0GDYYCSCIlZEfEp1LZS+1xU=; b=QTcbYs7xO18BAT4Cy+wY+qBCw59Y9fE6FUfVKLkdl5Lzqn8jrgKL8hyduehPvW077d 4JAlgGXz4y30JjEmx7Kp+zMVVfy9FbShVFqviKeiCHB6hPUthKUvTK1YSkjclwRS2Omn +QtzeM+DQAdcUvWZrUlFtrtsfgJEG87xdCg0ODyePC9jie74ouRx7xBmZY0ESYyplnIk 11r8n7psaaLbok4cEKxuuCJEGM1AlZWXC99GwSKo6idyUBGRM5XRy2LUMPdaDGc5nlqX Jl1PFFWXvYw4gaxPEnIpN0WTTc88HehfHtRDE/ATz2VBiEyyFAvQRgH68LHclxqbRoQH ECBA== X-Gm-Message-State: AJcUukcX0cTEu2otca092OPR7yYDvMVXJLbUx+0TeTLxkTNagi3fZHSD QU0Gclrb0A0oSIBsG+UbnBVDmw== X-Received: by 2002:a50:ca86:: with SMTP id x6mr6449388edh.287.1548335994205; Thu, 24 Jan 2019 05:19:54 -0800 (PST) Received: from [192.168.1.85] (ip-5-186-122-168.cgn.fibianet.dk. [5.186.122.168]) by smtp.gmail.com with ESMTPSA id n3-v6sm5894572ejd.35.2019.01.24.05.19.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 05:19:53 -0800 (PST) From: =?utf-8?Q?Javier_Gonz=C3=A1lez?= Message-Id: <251D7CB9-A9B0-4474-85A0-B0C23DB31272@javigon.com> Content-Type: multipart/signed; boundary="Apple-Mail=_4C7134AD-2365-491B-AABD-B50DFF810C0F"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH] lightnvm: pblk: stop taking the free lock in in pblk_lines_free Date: Thu, 24 Jan 2019 14:19:52 +0100 In-Reply-To: <20190122101531.30893-1-hans@owltronix.com> Cc: =?utf-8?Q?Matias_Bj=C3=B8rling?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Holmberg To: Hans Holmberg References: <20190122101531.30893-1-hans@owltronix.com> X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_4C7134AD-2365-491B-AABD-B50DFF810C0F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 22 Jan 2019, at 11.15, hans@owltronix.com wrote: >=20 > From: Hans Holmberg >=20 > pblk_line_meta_free might sleep (it can end up calling vfree, = depending > on how we allocate lba lists), and this can lead to a BUG() > if we wake up on a different cpu and release the lock. >=20 > As there is no point of grabbing the free lock when pblk has shut = down, > remove the lock. >=20 > Signed-off-by: Hans Holmberg > --- > drivers/lightnvm/pblk-init.c | 2 -- > 1 file changed, 2 deletions(-) >=20 > diff --git a/drivers/lightnvm/pblk-init.c = b/drivers/lightnvm/pblk-init.c > index f9a3e47b6a93..eb0135c77805 100644 > --- a/drivers/lightnvm/pblk-init.c > +++ b/drivers/lightnvm/pblk-init.c > @@ -584,14 +584,12 @@ static void pblk_lines_free(struct pblk *pblk) > struct pblk_line *line; > int i; >=20 > - spin_lock(&l_mg->free_lock); > for (i =3D 0; i < l_mg->nr_lines; i++) { > line =3D &pblk->lines[i]; >=20 > pblk_line_free(line); > pblk_line_meta_free(l_mg, line); > } > - spin_unlock(&l_mg->free_lock); >=20 > pblk_line_mg_free(pblk); >=20 > -- > 2.17.1 Can you add a comment too indicating that this is only safe on a single threaded shutdown? Otherwise the patch looks good. Reviewed-by: Javier Gonz=C3=A1lez --Apple-Mail=_4C7134AD-2365-491B-AABD-B50DFF810C0F 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----- iQIzBAEBCgAdFiEEU1dMZpvMIkj0jATvPEYBfS0leOAFAlxJu3gACgkQPEYBfS0l eOCuyhAArRVmwaa/qPpO2zswbdvgVTEmrp70HuE9YScahKYV2mMZ20diMV7wQeLd 7OHbHItSsKVi022iVxXtPd1qsbQw749XWiEYWCmiYWeR+Yu0CP3vEp2EAQgUYFq5 7zq+0ynaONgNJr9ExC/IQtkqh93xHg6Hfq0+wbm+UvXOHLCAd8DDKsz7PZHiyJHj gwVDdWGkaYTvQg7jj18i7O97J35s0fB2nsVZRN4MEQ4arT10Hi4IzeaBCKGmyXvf NdclQ5l+1z66cqsKkudtdUKY5VVSGBFmvJJ+ji8tjfG9mLYo1aMKrLj7/8V2RJG+ MFgR6dUNpiLLBN2+B1ZebeMuMSwMmIy6K8dOdUK+eiWtDBwut9Y+0h4ECdB29six g+7ejOCkmTRJaG0rEDmBKDEGADxOFmn8nyxG8+oTwVlQtfktsP8hMvm3INVUql9G okFZPQvoyViRwGJrckReFkre4CeV1SrynF0j/12Z0/BPcG4nxdmmId6MwTlsRtXc xknVCxGtt46A0bVRuAVnZ7nfZFugdbKxbIRv0JQM9RePI9ocFhY7Rr4gjqlC6tAN BmZbNf1/8uFXVWypRzoD7+EkkyJ282gBDHahHvCMyrMdAAEG7ykfLEZpMT3cQRXv 8b7y6FboTnpWfvsHMqpsw8cpxQjZ26EbopGziVo91/nsX3dOWNg= =0m2r -----END PGP SIGNATURE----- --Apple-Mail=_4C7134AD-2365-491B-AABD-B50DFF810C0F--