All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] Clarification of UML and AIO?
@ 2005-07-12 20:57 Allan Graves
  2005-07-12 22:03 ` Jeff Dike
  0 siblings, 1 reply; 4+ messages in thread
From: Allan Graves @ 2005-07-12 20:57 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

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)


[-- Attachment #2: allan.graves.vcf --]
[-- Type: text/x-vcard, Size: 147 bytes --]

begin:vcard
fn:Allan Graves
n:Graves;Allan
email;internet:allan.graves@oracle.com
tel;work:603-8973276
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] Clarification of UML and AIO?
  2005-07-12 20:57 [uml-devel] Clarification of UML and AIO? Allan Graves
@ 2005-07-12 22:03 ` Jeff Dike
  2005-07-13 13:39   ` Blaisorblade
  2005-07-13 17:57   ` Allan Graves
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Dike @ 2005-07-12 22:03 UTC (permalink / raw)
  To: Allan Graves; +Cc: user-mode-linux-devel

> 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

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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] Clarification of UML and AIO?
  2005-07-12 22:03 ` Jeff Dike
@ 2005-07-13 13:39   ` Blaisorblade
  2005-07-13 17:57   ` Allan Graves
  1 sibling, 0 replies; 4+ messages in thread
From: Blaisorblade @ 2005-07-13 13:39 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Jeff Dike, Allan Graves

On Wednesday 13 July 2005 00:03, Jeff Dike wrote:
> > 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

> 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.
-- 
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] Clarification of UML and AIO?
  2005-07-12 22:03 ` Jeff Dike
  2005-07-13 13:39   ` Blaisorblade
@ 2005-07-13 17:57   ` Allan Graves
  1 sibling, 0 replies; 4+ messages in thread
From: Allan Graves @ 2005-07-13 17:57 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

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

Jeff Dike wrote:

>>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
>>    
>>
>
>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
>  
>

[-- Attachment #2: allan.graves.vcf --]
[-- Type: text/x-vcard, Size: 147 bytes --]

begin:vcard
fn:Allan Graves
n:Graves;Allan
email;internet:allan.graves@oracle.com
tel;work:603-8973276
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-13 17:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-12 20:57 [uml-devel] Clarification of UML and AIO? Allan Graves
2005-07-12 22:03 ` Jeff Dike
2005-07-13 13:39   ` Blaisorblade
2005-07-13 17:57   ` Allan Graves

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.