[POWERPC] cell: Unify spufs syscall path
At present, a built-in spufs will not use the spufs_calls callbacks, but directly call sys_spu_create. This saves us an indirect branch, but means we have duplicated functions - one for CONFIG_SPU_FS=y and one for =m. This change unifies the spufs syscall path, and provides access to the spufs_calls structure through a get/put pair. At present, the only user of the spufs_calls structure is spu_syscalls.c, but this will facilitate adding the coredump calls later. Everyone likes numbers, right? Here's a before/after comparison with CONFIG_SPU_FS=y, doing spu_create(); close(); 64k times. Before: [jk@cell ~]$ time ./spu_create performing 65536 spu_create calls real 0m24.075s user 0m0.146s sys 0m23.925s After: [jk@cell ~]$ time ./spu_create performing 65536 spu_create calls real 0m24.777s user 0m0.141s sys 0m24.631s So, we're adding around 11us per syscall, at the benefit of having only one syscall path. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:

committed by
Paul Mackerras

parent
36ddbb1380
commit
98f06978ff
@@ -238,14 +238,14 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
|
||||
|
||||
/* syscalls implemented in spufs */
|
||||
struct file;
|
||||
extern struct spufs_calls {
|
||||
struct spufs_calls {
|
||||
asmlinkage long (*create_thread)(const char __user *name,
|
||||
unsigned int flags, mode_t mode,
|
||||
struct file *neighbor);
|
||||
asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc,
|
||||
__u32 __user *ustatus);
|
||||
struct module *owner;
|
||||
} spufs_calls;
|
||||
};
|
||||
|
||||
/* coredump calls implemented in spufs */
|
||||
struct spu_coredump_calls {
|
||||
@@ -274,18 +274,8 @@ struct spu_coredump_calls {
|
||||
#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */
|
||||
|
||||
|
||||
#ifdef CONFIG_SPU_FS_MODULE
|
||||
int register_spu_syscalls(struct spufs_calls *calls);
|
||||
void unregister_spu_syscalls(struct spufs_calls *calls);
|
||||
#else
|
||||
static inline int register_spu_syscalls(struct spufs_calls *calls)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void unregister_spu_syscalls(struct spufs_calls *calls)
|
||||
{
|
||||
}
|
||||
#endif /* MODULE */
|
||||
|
||||
int register_arch_coredump_calls(struct spu_coredump_calls *calls);
|
||||
void unregister_arch_coredump_calls(struct spu_coredump_calls *calls);
|
||||
|
Reference in New Issue
Block a user