From patchwork Thu Oct 5 08:35:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Holmberg X-Patchwork-Id: 9986523 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 B42AC6029B for ; Thu, 5 Oct 2017 08:37:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A21962876B for ; Thu, 5 Oct 2017 08:37:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93F8F28961; Thu, 5 Oct 2017 08:37:00 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 0A03B2876B for ; Thu, 5 Oct 2017 08:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751418AbdJEIg7 (ORCPT ); Thu, 5 Oct 2017 04:36:59 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:45742 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbdJEIgz (ORCPT ); Thu, 5 Oct 2017 04:36:55 -0400 Received: by mail-wm0-f43.google.com with SMTP id q124so640648wmb.0 for ; Thu, 05 Oct 2017 01:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owltronix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=6zpUuINFzWdr+CVviJkeYolDo0nc7yneP1so3xSqlo0=; b=d4YZ9hnT0fVotCvVnlKiy2WFrdJgedtYKtxbo7tCau+1lyKiIgFGDboP2vR5GAtm74 8haUqhyLEm1UxDjL5V1ChuEKdc6+qHvslgLlgh4B0wvoyrcMVk+RurDlo+ludhP5cXIu LxedcpSeoWQra/USlHqLc0dLQr1ovw2hDcV+3aX2HNnMufWtJLzXDcgib4/m5HyDCXjc zoss0ARzOMsxUbfqxs9vy/zkqTYBnb/DEu/CYgGHxI2Gzv68veC0RulQDxY+n1N2sQjl EsyUX7RrhNQci4ptYLnMMi24VvFZUGK/Hw6TAaE1l5EdCoJzDlKUVAgKfGZZcKdnstr3 +mRw== 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; bh=6zpUuINFzWdr+CVviJkeYolDo0nc7yneP1so3xSqlo0=; b=TUP45TYTpvXWYQV2eBlzxnBHAV4RZl6ExI9wyCrcDhICGayd58Hvg0lpW51hpn90M6 UfINJ6tKWKmtvrlVtuwL+wJm+gsRUEAD48hwf/dqh2MTDuJhVieHK3pKUVPUTtE/M5ZX 4GygHou7mFg7fe9s4JpAAlB0SEcbhO4lMm7dWF+QKTYBKlmS+GxYGKwxAbiSzWdrT6WZ 0pmmVZb4t03iGkny6bWMrdcv1LmsLaeSq97INn/j7s9sJKCY2NnTBqgsID3Z0hIQ3ZOK ZKXQgs5hTmgsqG5q0qc95NnULPbMve9voAVAhsU3rkgcisMrKbHlRd7MHTOkzVpt+Uqj UVpw== X-Gm-Message-State: AHPjjUhDnz2HOKoogPxssLxd7+5+Xi5nbNQW/tsHDh58wPUEl202fQwy /l4mdNJZR40KobdzUXq3rlEplg== X-Google-Smtp-Source: AOwi7QCvniBzPcEecUmAzKnZKVf1x4rPXWz6doNlIfJ8kMgp0qcT7DidYCNVsWlmmRBtQXJqWEwbDg== X-Received: by 10.80.212.150 with SMTP id s22mr32367925edi.286.1507192614210; Thu, 05 Oct 2017 01:36:54 -0700 (PDT) Received: from titan.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id d3sm13690913edd.41.2017.10.05.01.36.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Oct 2017 01:36:53 -0700 (PDT) From: Hans Holmberg To: Matias Bjorling Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Gonzales , Andrey Ryabinin , Hans Holmberg Subject: [PATCH] lightnvm: pblk: remove spinlock when freeing line metadata Date: Thu, 5 Oct 2017 10:35:46 +0200 Message-Id: <1507192546-12156-1-git-send-email-hans.ml.holmberg@owltronix.com> X-Mailer: git-send-email 2.7.4 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, so remove the lock. Signed-off-by: Hans Holmberg Reviewed-by: Andrey Ryabinin --- This patch is for: https://github.com/OpenChannelSSD/linux branch for-4.15/pblk 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 c452478..a645117 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); }