lkml.org 
[lkml]   [2017]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] lightnvm: pblk: remove spinlock when freeing line metadata
Date
From: Hans Holmberg <hans.holmberg@cnexlabs.com>

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 <hans.holmberg@cnexlabs.com>
---
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);
}
--
2.7.4
\
 
 \ /
  Last update: 2017-10-05 10:37    [W:0.034 / U:7.720 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site