mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 18:11:56 +00:00
fcf634098c
The basic idea behind cross memory attach is to allow MPI programs doing intra-node communication to do a single copy of the message rather than a double copy of the message via shared memory. The following patch attempts to achieve this by allowing a destination process, given an address and size from a source process, to copy memory directly from the source process into its own address space via a system call. There is also a symmetrical ability to copy from the current process's address space into a destination process's address space. - Use of /proc/pid/mem has been considered, but there are issues with using it: - Does not allow for specifying iovecs for both src and dest, assuming preadv or pwritev was implemented either the area read from or written to would need to be contiguous. - Currently mem_read allows only processes who are currently ptrace'ing the target and are still able to ptrace the target to read from the target. This check could possibly be moved to the open call, but its not clear exactly what race this restriction is stopping (reason appears to have been lost) - Having to send the fd of /proc/self/mem via SCM_RIGHTS on unix domain socket is a bit ugly from a userspace point of view, especially when you may have hundreds if not (eventually) thousands of processes that all need to do this with each other - Doesn't allow for some future use of the interface we would like to consider adding in the future (see below) - Interestingly reading from /proc/pid/mem currently actually involves two copies! (But this could be fixed pretty easily) As mentioned previously use of vmsplice instead was considered, but has problems. Since you need the reader and writer working co-operatively if the pipe is not drained then you block. Which requires some wrapping to do non blocking on the send side or polling on the receive. In all to all communication it requires ordering otherwise you can deadlock. And in the example of many MPI tasks writing to one MPI task vmsplice serialises the copying. There are some cases of MPI collectives where even a single copy interface does not get us the performance gain we could. For example in an MPI_Reduce rather than copy the data from the source we would like to instead use it directly in a mathops (say the reduce is doing a sum) as this would save us doing a copy. We don't need to keep a copy of the data from the source. I haven't implemented this, but I think this interface could in the future do all this through the use of the flags - eg could specify the math operation and type and the kernel rather than just copying the data would apply the specified operation between the source and destination and store it in the destination. Although we don't have a "second user" of the interface (though I've had some nibbles from people who may be interested in using it for intra process messaging which is not MPI). This interface is something which hardware vendors are already doing for their custom drivers to implement fast local communication. And so in addition to this being useful for OpenMPI it would mean the driver maintainers don't have to fix things up when the mm changes. There was some discussion about how much faster a true zero copy would go. Here's a link back to the email with some testing I did on that: http://marc.info/?l=linux-mm&m=130105930902915&w=2 There is a basic man page for the proposed interface here: http://ozlabs.org/~cyeoh/cma/process_vm_readv.txt This has been implemented for x86 and powerpc, other architecture should mainly (I think) just need to add syscall numbers for the process_vm_readv and process_vm_writev. There are 32 bit compatibility versions for 64-bit kernels. For arch maintainers there are some simple tests to be able to quickly verify that the syscalls are working correctly here: http://ozlabs.org/~cyeoh/cma/cma-test-20110718.tgz Signed-off-by: Chris Yeoh <yeohc@au1.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David Howells <dhowells@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: <linux-man@vger.kernel.org> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
359 lines
8.6 KiB
C
359 lines
8.6 KiB
C
/*
|
|
* List of powerpc syscalls. For the meaning of the _SPU suffix see
|
|
* arch/powerpc/platforms/cell/spu_callbacks.c
|
|
*/
|
|
|
|
SYSCALL(restart_syscall)
|
|
SYSCALL(exit)
|
|
PPC_SYS(fork)
|
|
SYSCALL_SPU(read)
|
|
SYSCALL_SPU(write)
|
|
COMPAT_SYS_SPU(open)
|
|
SYSCALL_SPU(close)
|
|
COMPAT_SYS_SPU(waitpid)
|
|
COMPAT_SYS_SPU(creat)
|
|
SYSCALL_SPU(link)
|
|
SYSCALL_SPU(unlink)
|
|
COMPAT_SYS(execve)
|
|
SYSCALL_SPU(chdir)
|
|
COMPAT_SYS_SPU(time)
|
|
SYSCALL_SPU(mknod)
|
|
SYSCALL_SPU(chmod)
|
|
SYSCALL_SPU(lchown)
|
|
SYSCALL(ni_syscall)
|
|
OLDSYS(stat)
|
|
SYSX_SPU(sys_lseek,ppc32_lseek,sys_lseek)
|
|
SYSCALL_SPU(getpid)
|
|
COMPAT_SYS(mount)
|
|
SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount)
|
|
SYSCALL_SPU(setuid)
|
|
SYSCALL_SPU(getuid)
|
|
COMPAT_SYS_SPU(stime)
|
|
COMPAT_SYS(ptrace)
|
|
SYSCALL_SPU(alarm)
|
|
OLDSYS(fstat)
|
|
SYSCALL(pause)
|
|
COMPAT_SYS(utime)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS_SPU(access)
|
|
COMPAT_SYS_SPU(nice)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL_SPU(sync)
|
|
COMPAT_SYS_SPU(kill)
|
|
SYSCALL_SPU(rename)
|
|
COMPAT_SYS_SPU(mkdir)
|
|
SYSCALL_SPU(rmdir)
|
|
SYSCALL_SPU(dup)
|
|
SYSCALL_SPU(pipe)
|
|
COMPAT_SYS_SPU(times)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL_SPU(brk)
|
|
SYSCALL_SPU(setgid)
|
|
SYSCALL_SPU(getgid)
|
|
SYSCALL(signal)
|
|
SYSCALL_SPU(geteuid)
|
|
SYSCALL_SPU(getegid)
|
|
SYSCALL(acct)
|
|
SYSCALL(umount)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS_SPU(ioctl)
|
|
COMPAT_SYS_SPU(fcntl)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS_SPU(setpgid)
|
|
SYSCALL(ni_syscall)
|
|
SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
|
|
COMPAT_SYS_SPU(umask)
|
|
SYSCALL_SPU(chroot)
|
|
COMPAT_SYS(ustat)
|
|
SYSCALL_SPU(dup2)
|
|
SYSCALL_SPU(getppid)
|
|
SYSCALL_SPU(getpgrp)
|
|
SYSCALL_SPU(setsid)
|
|
SYS32ONLY(sigaction)
|
|
SYSCALL_SPU(sgetmask)
|
|
COMPAT_SYS_SPU(ssetmask)
|
|
SYSCALL_SPU(setreuid)
|
|
SYSCALL_SPU(setregid)
|
|
SYS32ONLY(sigsuspend)
|
|
COMPAT_SYS(sigpending)
|
|
COMPAT_SYS_SPU(sethostname)
|
|
COMPAT_SYS_SPU(setrlimit)
|
|
COMPAT_SYS(old_getrlimit)
|
|
COMPAT_SYS_SPU(getrusage)
|
|
COMPAT_SYS_SPU(gettimeofday)
|
|
COMPAT_SYS_SPU(settimeofday)
|
|
COMPAT_SYS_SPU(getgroups)
|
|
COMPAT_SYS_SPU(setgroups)
|
|
SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
|
|
SYSCALL_SPU(symlink)
|
|
OLDSYS(lstat)
|
|
COMPAT_SYS_SPU(readlink)
|
|
SYSCALL(uselib)
|
|
SYSCALL(swapon)
|
|
SYSCALL(reboot)
|
|
SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir)
|
|
SYSCALL_SPU(mmap)
|
|
SYSCALL_SPU(munmap)
|
|
COMPAT_SYS_SPU(truncate)
|
|
COMPAT_SYS_SPU(ftruncate)
|
|
SYSCALL_SPU(fchmod)
|
|
SYSCALL_SPU(fchown)
|
|
COMPAT_SYS_SPU(getpriority)
|
|
COMPAT_SYS_SPU(setpriority)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS(statfs)
|
|
COMPAT_SYS(fstatfs)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS_SPU(socketcall)
|
|
COMPAT_SYS_SPU(syslog)
|
|
COMPAT_SYS_SPU(setitimer)
|
|
COMPAT_SYS_SPU(getitimer)
|
|
COMPAT_SYS_SPU(newstat)
|
|
COMPAT_SYS_SPU(newlstat)
|
|
COMPAT_SYS_SPU(newfstat)
|
|
SYSX(sys_ni_syscall,sys_uname,sys_uname)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL_SPU(vhangup)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS_SPU(wait4)
|
|
SYSCALL(swapoff)
|
|
COMPAT_SYS_SPU(sysinfo)
|
|
COMPAT_SYS(ipc)
|
|
SYSCALL_SPU(fsync)
|
|
SYS32ONLY(sigreturn)
|
|
PPC_SYS(clone)
|
|
COMPAT_SYS_SPU(setdomainname)
|
|
SYSCALL_SPU(newuname)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS_SPU(adjtimex)
|
|
SYSCALL_SPU(mprotect)
|
|
SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL(init_module)
|
|
SYSCALL(delete_module)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL(quotactl)
|
|
COMPAT_SYS_SPU(getpgid)
|
|
SYSCALL_SPU(fchdir)
|
|
SYSCALL_SPU(bdflush)
|
|
COMPAT_SYS(sysfs)
|
|
SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL_SPU(setfsuid)
|
|
SYSCALL_SPU(setfsgid)
|
|
SYSCALL_SPU(llseek)
|
|
COMPAT_SYS_SPU(getdents)
|
|
SYSX_SPU(sys_select,ppc32_select,sys_select)
|
|
SYSCALL_SPU(flock)
|
|
SYSCALL_SPU(msync)
|
|
COMPAT_SYS_SPU(readv)
|
|
COMPAT_SYS_SPU(writev)
|
|
COMPAT_SYS_SPU(getsid)
|
|
SYSCALL_SPU(fdatasync)
|
|
COMPAT_SYS(sysctl)
|
|
SYSCALL_SPU(mlock)
|
|
SYSCALL_SPU(munlock)
|
|
SYSCALL_SPU(mlockall)
|
|
SYSCALL_SPU(munlockall)
|
|
COMPAT_SYS_SPU(sched_setparam)
|
|
COMPAT_SYS_SPU(sched_getparam)
|
|
COMPAT_SYS_SPU(sched_setscheduler)
|
|
COMPAT_SYS_SPU(sched_getscheduler)
|
|
SYSCALL_SPU(sched_yield)
|
|
COMPAT_SYS_SPU(sched_get_priority_max)
|
|
COMPAT_SYS_SPU(sched_get_priority_min)
|
|
COMPAT_SYS_SPU(sched_rr_get_interval)
|
|
COMPAT_SYS_SPU(nanosleep)
|
|
SYSCALL_SPU(mremap)
|
|
SYSCALL_SPU(setresuid)
|
|
SYSCALL_SPU(getresuid)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL_SPU(poll)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL_SPU(setresgid)
|
|
SYSCALL_SPU(getresgid)
|
|
COMPAT_SYS_SPU(prctl)
|
|
COMPAT_SYS(rt_sigreturn)
|
|
COMPAT_SYS(rt_sigaction)
|
|
COMPAT_SYS(rt_sigprocmask)
|
|
COMPAT_SYS(rt_sigpending)
|
|
COMPAT_SYS(rt_sigtimedwait)
|
|
COMPAT_SYS(rt_sigqueueinfo)
|
|
COMPAT_SYS(rt_sigsuspend)
|
|
COMPAT_SYS_SPU(pread64)
|
|
COMPAT_SYS_SPU(pwrite64)
|
|
SYSCALL_SPU(chown)
|
|
SYSCALL_SPU(getcwd)
|
|
SYSCALL_SPU(capget)
|
|
SYSCALL_SPU(capset)
|
|
COMPAT_SYS(sigaltstack)
|
|
SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL(ni_syscall)
|
|
PPC_SYS(vfork)
|
|
COMPAT_SYS_SPU(getrlimit)
|
|
COMPAT_SYS_SPU(readahead)
|
|
SYS32ONLY(mmap2)
|
|
SYS32ONLY(truncate64)
|
|
SYS32ONLY(ftruncate64)
|
|
SYSX(sys_ni_syscall,sys_stat64,sys_stat64)
|
|
SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64)
|
|
SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64)
|
|
SYSCALL(pciconfig_read)
|
|
SYSCALL(pciconfig_write)
|
|
SYSCALL(pciconfig_iobase)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL_SPU(getdents64)
|
|
SYSCALL_SPU(pivot_root)
|
|
SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64)
|
|
SYSCALL_SPU(madvise)
|
|
SYSCALL_SPU(mincore)
|
|
SYSCALL_SPU(gettid)
|
|
SYSCALL_SPU(tkill)
|
|
SYSCALL_SPU(setxattr)
|
|
SYSCALL_SPU(lsetxattr)
|
|
SYSCALL_SPU(fsetxattr)
|
|
SYSCALL_SPU(getxattr)
|
|
SYSCALL_SPU(lgetxattr)
|
|
SYSCALL_SPU(fgetxattr)
|
|
SYSCALL_SPU(listxattr)
|
|
SYSCALL_SPU(llistxattr)
|
|
SYSCALL_SPU(flistxattr)
|
|
SYSCALL_SPU(removexattr)
|
|
SYSCALL_SPU(lremovexattr)
|
|
SYSCALL_SPU(fremovexattr)
|
|
COMPAT_SYS_SPU(futex)
|
|
COMPAT_SYS_SPU(sched_setaffinity)
|
|
COMPAT_SYS_SPU(sched_getaffinity)
|
|
SYSCALL(ni_syscall)
|
|
SYSCALL(ni_syscall)
|
|
SYS32ONLY(sendfile64)
|
|
COMPAT_SYS_SPU(io_setup)
|
|
SYSCALL_SPU(io_destroy)
|
|
COMPAT_SYS_SPU(io_getevents)
|
|
COMPAT_SYS_SPU(io_submit)
|
|
SYSCALL_SPU(io_cancel)
|
|
SYSCALL(set_tid_address)
|
|
SYSX_SPU(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
|
|
SYSCALL(exit_group)
|
|
SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie)
|
|
SYSCALL_SPU(epoll_create)
|
|
SYSCALL_SPU(epoll_ctl)
|
|
SYSCALL_SPU(epoll_wait)
|
|
SYSCALL_SPU(remap_file_pages)
|
|
SYSX_SPU(sys_timer_create,compat_sys_timer_create,sys_timer_create)
|
|
COMPAT_SYS_SPU(timer_settime)
|
|
COMPAT_SYS_SPU(timer_gettime)
|
|
SYSCALL_SPU(timer_getoverrun)
|
|
SYSCALL_SPU(timer_delete)
|
|
COMPAT_SYS_SPU(clock_settime)
|
|
COMPAT_SYS_SPU(clock_gettime)
|
|
COMPAT_SYS_SPU(clock_getres)
|
|
COMPAT_SYS_SPU(clock_nanosleep)
|
|
SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
|
|
COMPAT_SYS_SPU(tgkill)
|
|
COMPAT_SYS_SPU(utimes)
|
|
COMPAT_SYS_SPU(statfs64)
|
|
COMPAT_SYS_SPU(fstatfs64)
|
|
SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
|
|
PPC_SYS_SPU(rtas)
|
|
OLDSYS(debug_setcontext)
|
|
SYSCALL(ni_syscall)
|
|
COMPAT_SYS(migrate_pages)
|
|
COMPAT_SYS(mbind)
|
|
COMPAT_SYS(get_mempolicy)
|
|
COMPAT_SYS(set_mempolicy)
|
|
COMPAT_SYS(mq_open)
|
|
SYSCALL(mq_unlink)
|
|
COMPAT_SYS(mq_timedsend)
|
|
COMPAT_SYS(mq_timedreceive)
|
|
COMPAT_SYS(mq_notify)
|
|
COMPAT_SYS(mq_getsetattr)
|
|
COMPAT_SYS(kexec_load)
|
|
COMPAT_SYS(add_key)
|
|
COMPAT_SYS(request_key)
|
|
COMPAT_SYS(keyctl)
|
|
COMPAT_SYS(waitid)
|
|
COMPAT_SYS(ioprio_set)
|
|
COMPAT_SYS(ioprio_get)
|
|
SYSCALL(inotify_init)
|
|
SYSCALL(inotify_add_watch)
|
|
SYSCALL(inotify_rm_watch)
|
|
SYSCALL(spu_run)
|
|
SYSCALL(spu_create)
|
|
COMPAT_SYS(pselect6)
|
|
COMPAT_SYS(ppoll)
|
|
SYSCALL_SPU(unshare)
|
|
SYSCALL_SPU(splice)
|
|
SYSCALL_SPU(tee)
|
|
COMPAT_SYS_SPU(vmsplice)
|
|
COMPAT_SYS_SPU(openat)
|
|
SYSCALL_SPU(mkdirat)
|
|
SYSCALL_SPU(mknodat)
|
|
SYSCALL_SPU(fchownat)
|
|
COMPAT_SYS_SPU(futimesat)
|
|
SYSX_SPU(sys_newfstatat, sys_fstatat64, sys_fstatat64)
|
|
SYSCALL_SPU(unlinkat)
|
|
SYSCALL_SPU(renameat)
|
|
SYSCALL_SPU(linkat)
|
|
SYSCALL_SPU(symlinkat)
|
|
SYSCALL_SPU(readlinkat)
|
|
SYSCALL_SPU(fchmodat)
|
|
SYSCALL_SPU(faccessat)
|
|
COMPAT_SYS_SPU(get_robust_list)
|
|
COMPAT_SYS_SPU(set_robust_list)
|
|
COMPAT_SYS_SPU(move_pages)
|
|
SYSCALL_SPU(getcpu)
|
|
COMPAT_SYS(epoll_pwait)
|
|
COMPAT_SYS_SPU(utimensat)
|
|
COMPAT_SYS_SPU(signalfd)
|
|
SYSCALL_SPU(timerfd_create)
|
|
SYSCALL_SPU(eventfd)
|
|
COMPAT_SYS_SPU(sync_file_range2)
|
|
COMPAT_SYS(fallocate)
|
|
SYSCALL(subpage_prot)
|
|
COMPAT_SYS_SPU(timerfd_settime)
|
|
COMPAT_SYS_SPU(timerfd_gettime)
|
|
COMPAT_SYS_SPU(signalfd4)
|
|
SYSCALL_SPU(eventfd2)
|
|
SYSCALL_SPU(epoll_create1)
|
|
SYSCALL_SPU(dup3)
|
|
SYSCALL_SPU(pipe2)
|
|
SYSCALL(inotify_init1)
|
|
SYSCALL_SPU(perf_event_open)
|
|
COMPAT_SYS_SPU(preadv)
|
|
COMPAT_SYS_SPU(pwritev)
|
|
COMPAT_SYS(rt_tgsigqueueinfo)
|
|
SYSCALL(fanotify_init)
|
|
COMPAT_SYS(fanotify_mark)
|
|
SYSCALL_SPU(prlimit64)
|
|
SYSCALL_SPU(socket)
|
|
SYSCALL_SPU(bind)
|
|
SYSCALL_SPU(connect)
|
|
SYSCALL_SPU(listen)
|
|
SYSCALL_SPU(accept)
|
|
SYSCALL_SPU(getsockname)
|
|
SYSCALL_SPU(getpeername)
|
|
SYSCALL_SPU(socketpair)
|
|
SYSCALL_SPU(send)
|
|
SYSCALL_SPU(sendto)
|
|
COMPAT_SYS_SPU(recv)
|
|
COMPAT_SYS_SPU(recvfrom)
|
|
SYSCALL_SPU(shutdown)
|
|
COMPAT_SYS_SPU(setsockopt)
|
|
COMPAT_SYS_SPU(getsockopt)
|
|
COMPAT_SYS_SPU(sendmsg)
|
|
COMPAT_SYS_SPU(recvmsg)
|
|
COMPAT_SYS_SPU(recvmmsg)
|
|
SYSCALL_SPU(accept4)
|
|
SYSCALL_SPU(name_to_handle_at)
|
|
COMPAT_SYS_SPU(open_by_handle_at)
|
|
COMPAT_SYS_SPU(clock_adjtime)
|
|
SYSCALL_SPU(syncfs)
|
|
COMPAT_SYS_SPU(sendmmsg)
|
|
SYSCALL_SPU(setns)
|
|
COMPAT_SYS(process_vm_readv)
|
|
COMPAT_SYS(process_vm_writev)
|