All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Aaron Carroll <xaaronc@gmail.com>
Cc: "Akers, Jason B" <jason.b.akers@intel.com>,
	"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: syscall problem on Android x86
Date: Fri, 26 Apr 2013 20:27:13 -0600	[thread overview]
Message-ID: <20130427022713.GM9563@kernel.dk> (raw)
In-Reply-To: <CAKCZDgmFea+X0euVng1Fg3kEBrmmxc0SbjCk3W=n+HGa0NVJJQ@mail.gmail.com>

On Sat, Apr 27 2013, Aaron Carroll wrote:
> On 27 April 2013 03:43, Akers, Jason B <jason.b.akers@intel.com> 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


  reply	other threads:[~2013-04-27  2:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 17:43 syscall problem on Android x86 Akers, Jason B
2013-04-26 18:17 ` Jens Axboe
2013-04-26 19:46   ` Akers, Jason B
2013-04-26 20:04     ` Jens Axboe
2013-04-26 20:35       ` Akers, Jason B
2013-04-26 20:42         ` Jens Axboe
2013-04-27  1:59 ` Aaron Carroll
2013-04-27  2:27   ` Jens Axboe [this message]
2013-04-29 18:16     ` Akers, Jason B

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130427022713.GM9563@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=jason.b.akers@intel.com \
    --cc=xaaronc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.