From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] LTP: futex_wake04 hangs forever on i386
Date: Wed, 10 Oct 2018 14:05:50 +0200 [thread overview]
Message-ID: <20181010120550.GA1093@rei> (raw)
In-Reply-To: <29fce88c-c771-0ca4-19b9-c9eb25484999@linaro.org>
Hi!
> > Doing a simple math if you have serial line on 115200 it can transwer
> > about 11.5 bits in 100uS so yes we can easily overload serial connection
> > if we print messages that fast, so increasing the sleep 10x times sounds
> > only reasonable.
> >
> > On the other hand I guess that kernel shouldn't produce stalls just
> > because we write to serial too fast. I guess that the task writing to
> > serial should be sleeping in a waitqueue somewhere in kernel if it
> > attempts to write to a full serial buffer, which will effectivelly
> > slow down the writer and the test would work fine in this case...
>
> That is what happened, no ? Stack trace shows that possibly same process
> that had its execution interrupted by the time handler in a recent past
> (with a leftover frame pointer indicated by ? apic_timer_interrupt) also
> ran the handler for serial8250_interrupt() and that execution caused
> some dmesg warnings like:
>
> serial8250: too much work for irq
>
> which I had. I guess having the terminal with a smaller buffer would
> help here as well, since the calls to the interrupt handler would be
> more often and less time consuming (because of baud rate).
>
> Continuing, there was a software interrupt to flush serial 8250 contents
> and it took too long to flush to the device, causing the task, waiting
> on the line, to wait.
>
> HOWEVER, for this case, for example, every single byte written to a
> terminal memory mapped I/O register causes a VM_EXIT (in the host:
> cpu->kvm_run->exit_reason == 2), giving execution back to the QEMU vCPU
> (that had entered VM mode), that will schedule a function inside the
> emulation thread to deal with that I/O (for the virtualized serial HW
> being emulated) and calling the VM_ENTER again at some further point.
> This could make the interrupt handler even slower.
Ok, I guess that I understand why this is so slow, we emulate PC memory
mapped serial port and we go back and forth for each byte we write. And
I guess that we cannot do much about this.
Also I suppose that it could be "fixed" by switching to virtio serial
driver that should be able to read the whole buffer in one go.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2018-10-10 12:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 13:21 [LTP] LTP: futex_wake04 hangs forever on i386 Naresh Kamboju
2018-10-08 13:30 ` Cyril Hrubis
2018-10-09 2:05 ` Rafael David Tinoco
2018-10-09 9:28 ` Cyril Hrubis
2018-10-09 11:45 ` Rafael David Tinoco
2018-10-09 18:49 ` Rafael David Tinoco
2018-10-09 21:06 ` [LTP] [PATCH] futex/futex_wake04.c: fix issues with hugepages and usleep Rafael David Tinoco
2018-10-10 10:43 ` Cyril Hrubis
2018-10-10 11:14 ` Rafael David Tinoco
2018-10-10 12:06 ` Cyril Hrubis
2018-10-10 11:41 ` [LTP] [PATCH v2 1/2] futex/futex_wake04.c: fix hugepages setup for test Rafael David Tinoco
2018-10-10 11:41 ` [LTP] [PATCH v2 2/2] futex/futex_wake04.c: raise delay waiting for threads Rafael David Tinoco
2018-10-10 14:20 ` [LTP] [PATCH] futex/futex_wake04.c: fix issues with hugepages and usleep Rafael David Tinoco
2018-10-11 12:23 ` Cyril Hrubis
2018-10-10 10:41 ` [LTP] LTP: futex_wake04 hangs forever on i386 Cyril Hrubis
2018-10-10 11:13 ` Rafael David Tinoco
2018-10-10 12:05 ` Cyril Hrubis [this message]
2018-10-10 12:15 ` Rafael David Tinoco
2018-10-10 12:33 ` Cyril Hrubis
2018-10-10 12:48 ` Rafael David Tinoco
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=20181010120550.GA1093@rei \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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.