linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tuomas Tynkkynen <tuomas@tuxera.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Greg Kurz <groug@kaod.org>, <linux-fsdevel@vger.kernel.org>,
	<v9fs-developer@lists.sourceforge.net>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [V9fs-developer] 9pfs hangs since 4.7
Date: Mon, 9 Jan 2017 20:39:31 +0200	[thread overview]
Message-ID: <20170109203931.2315e1cd@duuni> (raw)
In-Reply-To: <20170107171910.GJ1555@ZenIV.linux.org.uk>

On Sat, 7 Jan 2017 17:19:10 +0000
Al Viro <viro@ZenIV.linux.org.uk> wrote:

> On Sat, Jan 07, 2017 at 04:10:45PM +0100, Greg Kurz wrote:
> > > virtqueue_push(), but pdu freeing is delayed until v9fs_flush() gets woken
> > > up.  In the meanwhile, another request arrives into the slot of freed by
> > > that virtqueue_push() and we are out of pdus.
> > >   
> > 
> > Indeed. Even if this doesn't seem to be the problem here, I guess this should
> > be fixed.  
> 
> 	FWIW, there's something that looks like an off-by-one in
> v9fs_device_realize_common():
>     /* initialize pdu allocator */
>     QLIST_INIT(&s->free_list);
>     QLIST_INIT(&s->active_list);
>     for (i = 0; i < (MAX_REQ - 1); i++) {
>         QLIST_INSERT_HEAD(&s->free_list, &s->pdus[i], next);
>         s->pdus[i].s = s;
>         s->pdus[i].idx = i;
>     }
> 
> Had been there since the original merge of 9p support into qemu - that code
> had moved around a bit, but it had never inserted s->pdus[MAX_REQ - 1] into
> free list.  So your scenario with failing pdu_alloc() is still possible.
> In that log the total amount of pending requests has reached 128 for the
> first time right when the requests had stopped being handled and even
> though it had dropped below that shortly after, extra requests being put
> into queue had not been processed at all...
> 

Yes, this does seem to be related to this or otherwise MAX_REQ related!
- Bumping MAX_REQ up to 1024 makes the hang go away (on 4.7).
- Dropping it to 64 makes the same hang happen on kernels where it worked
  before (I tried 4.4.x).
- Doing s/(MAX_REQ - 1)/MAX_REQ/ makes the hang go away.

I tested QEMU 2.8.0 as well and the behaviour is the same there.

Here are the logs for 4.4 hanging with MAX_REQ == 64 without the loop
condition changed:

https://gist.githubusercontent.com/dezgeg/b5f0b7f8a0f3d8b6acb1566d7edcb2f0/raw/00241426890ea28d844986243c3b706881432fb4/9p-44.dmesg.log
https://gist.githubusercontent.com/dezgeg/2bffe6c0271c4c9c382ac6363ce1864b/raw/92329eaef38305f82090de5dde3c944561afa372/9p-44.qemu.log

  parent reply	other threads:[~2017-01-09 18:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 19:50 9pfs hangs since 4.7 Tuomas Tynkkynen
2016-11-29 16:39 ` Eric Van Hensbergen
2016-12-02 20:11   ` Tuomas Tynkkynen
2017-01-02  8:20 ` Tuomas Tynkkynen
2017-01-02 16:23   ` Al Viro
2017-01-03 23:34     ` Tuomas Tynkkynen
2017-01-04  1:47       ` Al Viro
2017-01-04 20:04         ` Tuomas Tynkkynen
2017-01-04 23:01           ` Al Viro
2017-01-06 13:52             ` [V9fs-developer] " Greg Kurz
2017-01-07  6:26               ` Al Viro
2017-01-07 15:10                 ` Greg Kurz
2017-01-07 17:19                   ` Al Viro
2017-01-07 18:15                     ` Al Viro
2017-01-08  5:46                       ` Al Viro
2017-01-10  8:16                         ` Greg Kurz
2017-01-09 18:29                     ` Greg Kurz
2017-01-09 18:39                     ` Tuomas Tynkkynen [this message]
2017-01-09 20:05                       ` Al Viro

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=20170109203931.2315e1cd@duuni \
    --to=tuomas@tuxera.com \
    --cc=groug@kaod.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    --cc=viro@ZenIV.linux.org.uk \
    /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).