linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Menzel <pm.debian@googlemail.com>
To: Paul Taysom <taysom@chromium.org>
Cc: agk@redhat.com, dm-devel@redhat.com, neilb@suse.de,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	msb@chromium.org, mpatocka@redhat.com, olofj@chromium.org
Subject: Re: [PATCH] md: dm-verity: Fix to avoid a deadlock in dm-bufio
Date: Mon, 04 Mar 2013 18:19:15 +0100	[thread overview]
Message-ID: <1362417555.5510.58.camel@mattotaupa> (raw)
In-Reply-To: <1362415549-18653-1-git-send-email-taysom@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

Am Montag, den 04.03.2013, 08:45 -0800 schrieb Paul Taysom:
> Changed the dm-verity prefetching to use a worker thread to avoid
> a deadlock in dm-bufio.

Do you know of any bug reports about this? Searching for »dm-verity dead
lock« I found [1], which seems to be the issue, right? If yes, please
reference it.

> If generic_make_request is called recursively, it queues the I/O
> request on the current->bio_list without making the I/O request
> and returns. The routine making the recursive call cannot wait
> for the I/O to complete.
> 
> The deadlock occurred when one thread grabbed the bufio_client
> mutex and waited for an I/O to complete but the I/O was queued
> on another thread’s current->bio_list and it was waiting to get
> the mutex held by the first thread.
> 
> The fix allows only one I/O request from dm-verity to dm-bufio
> per thread. To do this, the prefetch requests were queued on worker
> threads.
> 
> In addition to avoiding the deadlock, this fix made a slight
> improvement in performance.
> 
> seconds_kernel_to_login:
>   with prefetch:    8.43s
>   without prefetch: 9.2s
>   worker prefetch:  8.28s
> 
> Signed-off-by: Paul Taysom <taysom@chromium.org>
> ---
>  drivers/md/dm-verity.c | 29 +++++++++++++++++++++++++++--
>  1 file changed, 27 insertions(+), 2 deletions(-)

Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>


Thanks,

Paul


[1] https://code.google.com/p/chromium-os/issues/detail?id=39148

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2013-03-04 17:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 16:45 [PATCH] md: dm-verity: Fix to avoid a deadlock in dm-bufio Paul Taysom
2013-03-04 17:19 ` Paul Menzel [this message]
2013-03-04 21:21   ` Paul Taysom
2013-03-04 17:42 ` Alasdair G Kergon
2013-03-04 21:23   ` Paul Taysom
2013-03-04 22:15     ` Mikulas Patocka
2013-03-05 23:30       ` Paul Taysom
2013-03-12 14:46         ` Paul Taysom
2013-03-13 20:18           ` Paul Taysom

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=1362417555.5510.58.camel@mattotaupa \
    --to=pm.debian@googlemail.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=msb@chromium.org \
    --cc=neilb@suse.de \
    --cc=olofj@chromium.org \
    --cc=taysom@chromium.org \
    /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;
as well as URLs for NNTP newsgroup(s).