All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Yuan <namei.unix@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] 100% CPU when sockfd is half-closed and unexpected behavior for qemu_co_send()
Date: Mon, 14 Jan 2013 18:26:50 +0800	[thread overview]
Message-ID: <50F3DD6A.8080000@gmail.com> (raw)
In-Reply-To: <20130114102303.GA11988@stefanha-thinkpad.redhat.com>

On 01/14/2013 06:23 PM, Stefan Hajnoczi wrote:
> On Mon, Jan 14, 2013 at 04:16:34PM +0800, Liu Yuan wrote:
>> Hi List,
>>   This problem can be reproduced by:
>>   1. start a sheepdog cluster and create a volume 'test'*
>>   2. attach 'test' to a bootable image like
>>      $ qemu -hda image -drive if=virtio,file=sheepdog:test
>>   3. pkill sheep # create a half-closed situation
>>
>> I have straced it that QEMU is busy doing nonsense read/write() after
>> select() in os_host_main_loop_wait(). I have no knowledge of
>> glib_select_xxx, so someone please help fix it.
> 
> You mentioned a nonsense read().  What is the return value?
> 
> If you get a read with return value 0, this tells you the socket has
> been closed.  Can you handle these cases in block/sheepdog.c?
> 

This is what I saw repeatedly:

select(25, [3 4 5 8 9 10 13 18 19 24], [], [], {1, 0}) = 2 (in [5 13],
left {0, 999994})
read(5, "\6\0\0\0\0\0\0\0", 16)         = 8
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
....

5 isn't a sockfd that sheepdog uses.

I don't know if I can handle it in sheepdog.c because I noticed that
there isn't any function called when this happens. So I suspect this
should be handle at upper block core.

Thanks,
Yuan

      reply	other threads:[~2013-01-14 10:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14  8:16 [Qemu-devel] 100% CPU when sockfd is half-closed and unexpected behavior for qemu_co_send() Liu Yuan
2013-01-14  9:09 ` Paolo Bonzini
2013-01-14  9:29   ` Liu Yuan
2013-01-14 10:07     ` Paolo Bonzini
2013-01-16  6:39       ` Liu Yuan
2013-01-14 10:23 ` Stefan Hajnoczi
2013-01-14 10:26   ` Liu Yuan [this message]

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=50F3DD6A.8080000@gmail.com \
    --to=namei.unix@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.