From patchwork Fri Oct 13 12:46:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 10004483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89D8A6037E for ; Fri, 13 Oct 2017 12:49:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B32929057 for ; Fri, 13 Oct 2017 12:49:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F5B42905E; Fri, 13 Oct 2017 12:49:55 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 7F01B2905C for ; Fri, 13 Oct 2017 12:49:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329AbdJMMtv (ORCPT ); Fri, 13 Oct 2017 08:49:51 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:49815 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932461AbdJMMr7 (ORCPT ); Fri, 13 Oct 2017 08:47:59 -0400 Received: by mail-wm0-f67.google.com with SMTP id b189so21118018wmd.4 for ; Fri, 13 Oct 2017 05:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DjdpIOhOthD3lByXH+MlAIMt/oT6iVgf/pydQfs/eTg=; b=vaslWTJ83AMkZc++Kb1DD5F+Lu3ErTMpapyPp9r0ynYLCd7eR5gL+ud4fyAFlbNVKG /NmridGqRlSQR6l+L7KdlvZKi2jOhDewrlAUrYjbFLttgbLwDQXPVIXZ6TWX2W65iMGL LQos+ixWw8CR9yn4mmfu2isqrU/DxIHT0Wabo= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=DjdpIOhOthD3lByXH+MlAIMt/oT6iVgf/pydQfs/eTg=; b=AnZfQ+17cSS3xYgn0YEAg990O5AEVOFsoXZ57v159PP1VssC9Cd53ukHTXOgnSzRuH 2tjl6L6fSgEmKr4jW5Q8wVHdKpmYvNs16dT6cPaowDSxZh8LIVolRS/obFWcRObc3z9M KNUY0bkzYrbJ9gsC9CvrMJtr8hdEV8B9XtL8MZj3iE0sFYTRYLqwKMGCRIcxYY9DCmYi 1qjuxr4pzs1U0vI9bDGtfQaczrZFhHai4R/K5f9u8VWOzBHIMbCoARQCFonoeV61VMoA OsUpiFIlJaGj4UI6WtBnD+ZX3UmWF3995nwTVcCUd2ZcbMon5m+goKa2aWI9W1MuiT51 hZuw== X-Gm-Message-State: AMCzsaXm62j4spYzwLbbbar4XW1Qa4LBFZUh67j3cuWcSrcl3C8nIBjh /UXUnmeVdtSNnjpDtmdzkN3wtQ== X-Google-Smtp-Source: AOwi7QBXKmdPBK/KV5fDwodOmjbzYJoN3M1Ppbr8R+ZizwJYEtQBRKaEA1ZGthVR9cdgzyhFYOX/eA== X-Received: by 10.80.244.189 with SMTP id s58mr545480edm.234.1507898878242; Fri, 13 Oct 2017 05:47:58 -0700 (PDT) Received: from skyninja.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id p91sm735012edp.69.2017.10.13.05.47.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 05:47:57 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Holmberg , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [GIT PULL 54/58] lightnvm: pblk: remove spinlock when freeing line metadata Date: Fri, 13 Oct 2017 14:46:43 +0200 Message-Id: <20171013124647.32668-55-m@bjorling.me> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171013124647.32668-1-m@bjorling.me> References: <20171013124647.32668-1-m@bjorling.me> 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 From: Hans Holmberg Lockdep complains about being in atomic context while freeing line metadata - and rightly so as we take a spinlock and end up calling vfree that might sleep(in pblk_mfree). There is no need for holding the line manager free_lock while freeing line metadata as the pipeline as stopped, so remove the lock. Fixes: 588726d3ec68 ("lightnvm: pblk: fail gracefully on irrec. error") Signed-off-by: Hans Holmberg Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 52c85f4..f62112b 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -393,13 +393,11 @@ static void pblk_line_meta_free(struct pblk *pblk) kfree(l_mg->bb_aux); kfree(l_mg->vsc_list); - spin_lock(&l_mg->free_lock); for (i = 0; i < PBLK_DATA_LINES; i++) { kfree(l_mg->sline_meta[i]); pblk_mfree(l_mg->eline_meta[i]->buf, l_mg->emeta_alloc_type); kfree(l_mg->eline_meta[i]); } - spin_unlock(&l_mg->free_lock); kfree(pblk->lines); }