From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: "Javier González" <jg@lightnvm.io>
Cc: "Hans Holmberg" <hans.ml.holmberg@owltronix.com>,
"Matias Bjørling" <mb@lightnvm.io>,
linux-block@vger.kernel.org,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Christoph Hellwig" <hch@lst.de>,
"Hans Holmberg" <hans.holmberg@cnexlabs.com>
Subject: Re: [PATCH] lightnvm: pblk: use vfree_atomic when freeing line metadata
Date: Tue, 3 Oct 2017 17:20:20 +0300 [thread overview]
Message-ID: <2aa049d5-3c31-eabc-a995-499807837a19@virtuozzo.com> (raw)
In-Reply-To: <9AF41216-3CB7-4AFA-B461-0957074AF0A5@lightnvm.io>
On 10/03/2017 05:11 PM, Javier González wrote:
>> On 3 Oct 2017, at 16.07, Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
>>
>>
>>
>> On 10/03/2017 04:48 PM, Hans Holmberg wrote:
>>> From: Hans Holmberg <hans.holmberg@cnexlabs.com>
>>>
>>> The commit bf22e37a6413 ("mm: add vfree_atomic()") made vfree unsafe to
>>> call in atomic context (unless the call came from an interrupt) and
>>> introduced vfree_atomic that is safe to call in atomic context.
>>>
>>> So, since we're holding locks when freeing line metadata, we need to
>>> use the atomic version of vfree.
>>>
>>> Fix this by introducing an atomic variant of pblk_mfree and
>>> switching to that in pblk_line_meta_free.
>>>
>>> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
>>> ---
>>>
>>> The patch is for:
>>> https://github.com/OpenChannelSSD/linux branch for-4.15/pblk
>>>
>>> drivers/lightnvm/pblk-init.c | 3 ++-
>>> drivers/lightnvm/pblk.h | 8 ++++++++
>>> 2 files changed, 10 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
>>> index c452478..3a191a6 100644
>>> --- a/drivers/lightnvm/pblk-init.c
>>> +++ b/drivers/lightnvm/pblk-init.c
>>> @@ -396,7 +396,8 @@ static void pblk_line_meta_free(struct pblk *pblk)
>>> spin_lock(&l_mg->free_lock);
>>
>> What's the point in holding ->free_lock here? It seems like it could be just dropped.
>>
>
> This lock can indeed be dropped,
So, let's do this. This would be the best way to fix this.
> but the general pblk semaphore, which
> serializes initialization and tear down cannot. This is taken on
> pblk_exit().
>
But semaphore is not the problem here. We can sleep under semaphore, so it's fine.
> Javier
>
next prev parent reply other threads:[~2017-10-03 14:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 13:48 Hans Holmberg
2017-10-03 14:07 ` Andrey Ryabinin
2017-10-03 14:11 ` Javier González
2017-10-03 14:20 ` Andrey Ryabinin [this message]
2017-10-03 14:43 ` Javier González
2017-10-03 14:49 ` Javier González
2017-10-03 15:00 ` Hans Holmberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2aa049d5-3c31-eabc-a995-499807837a19@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=hans.holmberg@cnexlabs.com \
--cc=hans.ml.holmberg@owltronix.com \
--cc=hch@lst.de \
--cc=jg@lightnvm.io \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@lightnvm.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®