Re: syscall problem on Android x86

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

 



On Sat, Apr 27 2013, Aaron Carroll wrote:
> On 27 April 2013 03:43, Akers, Jason B <jason.b.akers@xxxxxxxxx> wrote:
> > Fio hangs when run on the Android x86 emulator.
> >
> > Tracking through, I found that the last call made is shmget() (in init.c - setup_thread_area()).
> > I believe that the hang is related to the fio syscall implementation for x86.
> >
> > os-android.h defines shmget as: syscall(__NR_shmget, __key, __size, __shmflg);
> >
> > In arch-x86.h __NR_shmget is defined to 29. This was added on April 11th (a415b2cc).
> >
> > Looking deeper, I see that syscall 29 is actually mapped to pause(). (see SYSCALLS.TXT in bionic/libc) I confirmed that sys_pause() was being called by using a kernel breakpoint. This explains why fio hangs.
> 
> You are right, I added the 64bit syscall number.
> 
> > Now the question is: What to do about it?
> 
>  * Either junk the __NR_shm* definitions, or move them to x86-64 for
> future 64bit Android compatibility
>  * The shm* functions need different definitions for x86-32, because
> there are no shm* syscalls. They appear to be multiplexed over an IPC
> syscall.

Hmm good point, I had (wrongly) assumed that the abi was in sync for 32
and 64-bit x86, but that is not the case. For x86, you have to do
ipc(SHMGET, ...) etc to get at it.

I'll move the definitions to x86-64 where they belong.

> As Jens said this has nothing to do with Android per se, only that its
> libc does not implement shm*() so we have to do it ourselves.

Yep. Jason, it should be fairly easy to wire up ipc(). Or you can do the
android variant, I'm fine with either.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux