History | View | Annotate | Download (16.6 kB)
consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()
This patch combines two functions into one, and replacesthe implementation with already existing iov_memset() fromiov.c.
The new prototype of qemu_iovec_memset():...
aio: remove process_queue callback and qemu_aio_process_queue
Both unused after the previous patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
posix-aio: merge posix_aio_process_queue and posix_aio_read
posix_aio_read already calls qemu_aio_process_queue, and duallyqemu_aio_process_queue is always followed by a select loop that callsposix_aio_read.
No races are possible, so there is no need for a separate process_queue...
prepare for future GPLv2+ relicensing
All files under GPLv2 will get GPLv2+ changes starting tomorrow.event_notifier.c and exec-obsolete.h were only ever touched by Red Hatemployees and can be relicensed now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
block: qemu_aio_get does not return NULL
Initially done with the following semantic patch:
rule1 expression E;statement S;@@ E = qemu_aio_get (...);(- if (E == NULL) { ... } |- if (E) { <... S ...> })
rule1
which however missed occurrences in linux-aio.c and posix-aio-compat.c....
Fix spelling in comments, documentation and messages
accidently->accidentallyannother->anotherchoosen->chosenconsideres->considersdecriptor->descriptordevelopement->developmentparamter->parameterpreceed->precedepreceeding->precedingpriviledge->privilege...
posix-aio-compat: Plug memory leak on paio_init() error path
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: avoid SIGUSR2
Now that iothread is always compiled sending a signal seems only anadditional step. This patch also avoid writing to two pipe (one from signaland one in qemu_service_io).
Work with kvm enabled or disabled. strace output is more readable (less syscalls)....
posix-aio-compat: Removed unused offset variable
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
posix-aio-compat: fix latency issues
In certain circumstances, posix-aio-compat can incur a lot of latency: - threads are created by vcpu threads, so if vcpu affinity is set, aio threads inherit vcpu affinity. This can cause many aio threads to compete for one cpu....
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
async: Remove AsyncContext
The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancyduring an emulated bdrv_read/write (which includes a qemu_aio_wait() call andcan run AIO callbacks of different requests if it weren't for AsyncContexts)....
posix-aio-compat: Allow read after EOF
In order to be able to transparently replace bdrv_read calls by bdrv_co_read,reading beyond EOF must produce zeros instead of short reads for AIO, too.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Fix compilation warning due to missing header for sigaction (followup)
This patch removes all references to signal.h when qemu-common.h is includedas they become redundant.
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
posix-aio-compat: Fix idle_threads counter
A thread should only be counted as idle when it really is waiting for newrequests. Without this patch, sometimes too few threads are started as busythreads are counted as idle.
Not sure if it makes a difference in practice outside some artificial...
trace: Trace posix-aio-compat.c completion and cancellation
This patch adds paio_complete() and paio_cancel() trace events tocomplement the paio_submit() event.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Move qemu_gettimeofday() to OS specific files
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix spelling in comments
multifuction -> multifunctionsuccessfull -> successful.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
use qemu_blockalign consistently
Use qemu_blockalign for all allocations in the block layer. This allowsincreasing the required alignment, which is need to support O_DIRECT ondevices with large block sizes.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
trace: Trace virtio-blk, multiwrite, and paio_submit
This patch adds trace events that make it possible to observevirtio-blk.
posix-aio-compat: Fix async_conmtext for ioctl
Set the async_context_id field when queuing an async ioctl call
Signed-off-by: Andrew de Quincey <adq@lidskialf.net>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
posix-aio-compat: Expand tabs that have crept in
This patch expands tabs on a few lines so the code formats nicely andfollows the QEMU coding style.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
posix-aio-compat.c: fix warning with _FORTIFY_SOURCE
CC posix-aio-compat.occ1: warnings being treated as errorsposix-aio-compat.c: In function 'aio_signal_handler':posix-aio-compat.c:505: error: ignoring return value of 'write', declared with attribute warn_unused_result...
posix-aio-compat: Fix error check
Checking for nbytes < 0 is pointless as long as it's a size_t. If we want touse negative numbers for error codes, we should use signed types.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
Remove aio_ctx from paio_* interface
The context parameter in paio_submit isn't used anyway, so there is no reasonwhy block drivers should need to remember it. This also avoids passing a LinuxAIO context to paio_submit (which doesn't do any harm as long as the parameter...
Add qemu_aio_process_queue()
We'll leave some AIO completions unhandled when we can't call the callback.qemu_aio_process_queue() is used later to run any callbacks that are left andcan be run then.
posix-aio-compat: Honour AsyncContext
Don't call callbacks that don't belong to the active AsyncContext.
posix-aio-compat: Split out posix_aio_process_queue
We need to process the request queue and run callbacks separately from readingout the queue in a later patch, so split it out.
posix-aio-compat: avoid signal race when spawning a thread
Signed-off-by: malc <av1474@comtv.ru>
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
Unbreak BSD: use qemu_fdatasync instead of fdatasync
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
block: add aio_flush operation
Instead stalling the VCPU while serving a cache flush try to do itasynchronously. Use our good old helper thread pool to issue anasynchronous fdatasync for raw-posix. Note that while Linux AIOimplements a fdatasync operation it is not useful for us because...
raw-posix: refactor AIO support
Currently the raw-posix.c code contains a lot of knowledge about theasynchronous I/O scheme that is mostly implemented in posix-aio-compat.c.All this code does not really belong here and is getting a bit in theway of implementing native AIO on Linux....
rename HAVE_PREADV to CONFIG_PREADV
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fix asynchronous ioctls
posix_aio_read expect aio requests to return the number of bytesrequests to be successfull, so we need to fake this up for ioctls.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
native preadv/pwritev support (Christoph Hellwig)
This ties up the preadv/pwritev syscalls to qemu if they are declared inunistd.h. This is the case currently on at least NetBSD and OpenBSD andwill hopefully soon be the case on Linux.
Thanks to Blue Swirl and Gerd Hoffmann for the configure autodetection...
push down vector linearization to posix-aio-compat.c (Christoph Hellwig)
Make all AIO requests vectored and defer linearization until the actualI/O thread. This prepares for using native preadv/pwritev.
Also enables asynchronous direct I/O by handling that case in the I/O thread....
new scsi-generic abstraction, use SG_IO (Christoph Hellwig)
Okay, I started looking into how to handle scsi-generic I/O in thenew world order.
I think the best is to use the SG_IO ioctl instead of the read/writeinterface as that allows us to support scsi passthrough on disk/cdrom...
Properly handle pthread_cond_timedwait timing out
pthread_cond_timedwait is allowed to both consume the signal andreturn with the value indicating the timeout, hence predicate shouldalways be (re)checked before taking an action
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6634 c046a42c-6fe2-441c-8c8c-71466251a162
Cosmetics
Avoid repeated creation/initalization/destruction of attr and calls togetpid
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6633 c046a42c-6fe2-441c-8c8c-71466251a162
Avoid thundering herd problem
Broadcast was used so that the I/O threads would wakeup, reset theirts values and all but one go to sleep, in other words an optimizationto prevent threads from exiting in presence of continuing I/Oactivity. Spurious wakeups make the looping around cond_timedwait with...
Avoid infinite loop around timed condition variable
This can happen due to spurious wakeups
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6631 c046a42c-6fe2-441c-8c8c-71466251a162
Error checking
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6630 c046a42c-6fe2-441c-8c8c-71466251a162
Rename sigev_signo to avoid FreeBSD problems (Juergen Lock)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6414 c046a42c-6fe2-441c-8c8c-71466251a162
Use kill instead of sigqueue: re-enables AIO on OpenBSD
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6360 c046a42c-6fe2-441c-8c8c-71466251a162
Fix race in POSIX AIO emulation (Jan Kiszka)
When we cancel an AIO request that is already being processed byaio_thread, qemu_paio_cancel should return QEMU_PAIO_NOTCANCELED as longas aio_thread isn't done with this request. But as the latter currently...
Remove unnecessary trailing newlines
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
Replace posix-aio with custom thread pool
glibc implements posix-aio as a thread pool and imposes a number of limitations.
1) it limits one request per-file descriptor. we hack around this by dup()'ingfile descriptors which is hideously ugly
2) it's impossible to add new interfaces and we need a vectored read/write...