Clarification of UML and AIO?
Hi guys... Trying to do some AIO stuff here, and got a question. Perhaps I'm not understanding how AIO works in UML... Could someone perhaps give me an explanation of why we end up in pread, instead of aio? Does UML not support AIO through its block device driver? Thank you,
Allan
The simple test program:
#include <aio.h>
#include <errno.h>
#include <fcntl.h>
main()
{
struct aiocb aiocb;
int fd;
char buf[1024];
fd = open("/tmp/outfile", O_RDONLY);
perror("open");
bzero(&aiocb, sizeof(aiocb));
aiocb.aio_fildes = fd;
aiocb.aio_buf = buf;
aiocb.aio_nbytes = sizeof(buf);
aio_read(&aiocb);
perror("aio_read");
while (aio_error(&aiocb) == EINPROGRESS);
printf("buf = %s\n", buf);
}Tracing the aio_read() through the UML kernel finally gets me here:
#0 sys_pread64 (fd=3, buf=0xbf7c8f20 "", count=1024, pos=0)
at fs/read_write.c:354
#1 0x08062ff8 in execute_syscall_skas (r=0x12374864)
at arch/um/kernel/skas/syscall_kern.c:29
#2 0x0806302f in handle_syscall (regs=0x12374864)
at arch/um/kernel/skas/syscall_user.c:25
#3 0x08062651 in userspace (regs=0x12374864)
at arch/um/kernel/skas/process.c:91
#4 0x08062d44 in fork_handler (sig=10) at thread_info.h:47 #5 <signal handler called> #6 0xffffe410 in __kernel_vsyscall () #7 0x00000000 in ?? ()
(gdb)
begin:vcard
fn:Allan Graves
n:Graves;Allan
email;internet:[email protected]
tel;work:603-8973276
x-mozilla-html:FALSE
version:2.1
end:vcard
Quoted 6 lines
Tracing the
aio_read()through the UML kernel finally gets me here:#0
sys_pread64(fd=3, buf=0xbf7c8f20 "", count=1024, pos=0)
atfs/read_write.c:354
#10x08062ff8inexecute_syscall_skas(r=0x12374864)
atarch/um/kernel/skas/syscall_kern.c:29
Finally? That's the very beginning of the system call (or the very end).
The UML block device doesn't know about AIO. All it does is get blocks from a disk.
Are you sure you're getting kernel AIO and not the libc emulation of it?
Jeff
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 7 lines · Jeff Dike
Quoted 6 lines
Tracing the
aio_read()through the UML kernel finally gets me here:#0
sys_pread64(fd=3, buf=0xbf7c8f20 "", count=1024, pos=0)
atfs/read_write.c:354
#10x08062ff8inexecute_syscall_skas(r=0x12374864)
atarch/um/kernel/skas/syscall_kern.c:29
Quoted 6 lines
Finally? That's the very beginning of the system call (or the very end).
The UML block device doesn't know about AIO. All it does is get blocks from a disk.
Are you sure you're getting kernel AIO and not the libc emulation of it?
This is a good answer.... strace will be your friend in verifying this.
Signature · 23 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Jeff, Blaisor, you're exactly right. Linux aio uses io_submit, not aio_read, it seems. aio_read calls clone to make a new thread to do its "aio". Thank you all for your help. Allan
Quoted 9 lines · Jeff Dike
Quoted 8 lines
Tracing the
aio_read()through the UML kernel finally gets me here:#0
sys_pread64(fd=3, buf=0xbf7c8f20 "", count=1024, pos=0)
atfs/read_write.c:354
#10x08062ff8inexecute_syscall_skas(r=0x12374864)
atarch/um/kernel/skas/syscall_kern.c:29
Quoted 10 lines
Finally? That's the very beginning of the system call (or the very end).
The UML block device doesn't know about AIO. All it does is get blocks from a disk.
Are you sure you're getting kernel AIO and not the libc emulation of it?
Jeff
begin:vcard
fn:Allan Graves
n:Graves;Allan
email;internet:[email protected]
tel;work:603-8973276
x-mozilla-html:FALSE
version:2.1
end:vcard