qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Replace posix-aio with custom thread pool


From: Andrea Arcangeli
Subject: Re: [Qemu-devel] [RFC] Replace posix-aio with custom thread pool
Date: Wed, 10 Dec 2008 17:44:01 +0100

On Tue, Dec 09, 2008 at 10:01:34AM -0600, Anthony Liguori wrote:
> Yes, that's what I'm going to do before committing it.

I've been hacking on this too, just to push out a full tested patchset
without the _em badness... problem is if we use more than one thread,
there's a thread race between lseek and writev, pread/pwrite don't
have the issue as they store the pos on the kernel stack, and they
don't pass through the shared file->f_pos. We'd really need
preadv/pwritev...

To solve this in userland without kernel aio we'd need to open (not
just dup) the file in each thread, then the file->f_pos will become
thread local and we can cache the last lseek value and avoid the lseek
syscall for contiguous I/O. Or we need to reduce the number of threads
to 1 per fd (screwing seeking I/O). kernel aio wouldn't have this
trouble and a single fd/file would be enough, but that would only work
on linux.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]