Skip to contentSkip to conversation

splice: Disable vmsplice on nommu.

PATCH In review Paul Mundt 3 participants 5 messages Sep 11, 2007

Subsystems (2)
lore
Share & tools
lore

Paul Mundt

author
#0 lore raw

PATCH 1/1 splice: Disable vmsplice on nommu.

The vmsplice rework in -mm breaks nommu:

fs/built-in.o: In function `splice_setup_vma':
fs/splice.c:1272: undefined reference to may_expand_vm' fs/splice.c:1272: undefined reference to protection_map' fs/splice.c:1272: undefined reference to insert_vm_struct' fs/splice.c:1272: undefined reference to vm_stat_account'

This is going to be non-trivial to wire up properly on nommu, and it's debateable whether there's even any point in trying. For now, disable vmsplice if CONFIG_MMU=n and wire it up as a cond syscall for the platforms that support both.

--

 fs/splice.c     |    2 ++
 kernel/sys_ni.c |    1 +
 2 files changed, 3 insertions(+)
fs/splice.c +2 -0
@@ -1180,6 +1180,7 @@
 	return -EINVAL;
 }
 
+#ifdef CONFIG_MMU
 /*
  * Undo vmsplice_to_user map. Basically just lookup the vmas and
  * detach/unmap/remove them.
@@ -1686,6 +1687,7 @@
 
 	return error;
 }
+#endif /* CONFIG_MMU */
 
 asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
 			   int fd_out, loff_t __user *off_out,
kernel/sys_ni.c +1 -0
@@ -139,6 +139,7 @@
 cond_syscall(sys_madvise);
 cond_syscall(sys_mremap);
 cond_syscall(sys_remap_file_pages);
+cond_syscall(sys_vmsplice);
 cond_syscall(compat_sys_move_pages);
 cond_syscall(compat_sys_migrate_pages);
 
#1 lore raw
Quoted 8 lines · Paul Mundt

The vmsplice rework in -mm breaks nommu:

fs/built-in.o: In function `splice_setup_vma':
fs/splice.c:1272: undefined reference to may_expand_vm' fs/splice.c:1272: undefined reference to protection_map' fs/splice.c:1272: undefined reference to insert_vm_struct' fs/splice.c:1272: undefined reference to vm_stat_account'

Quoted 4 lines

This is going to be non-trivial to wire up properly on nommu, and it's debateable whether there's even any point in trying. For now, disable vmsplice if CONFIG_MMU=n and wire it up as a cond syscall for the platforms that support both.

It's a bit of a sledge hammer... Since get_user_pages() appears to work on nummu, we can just disable the vmsplice-to-userspace bits and leave the (working) vmsplice-from-userspace in place.

I'm reworking this code anyway in the block branches, so I'll update and take CONFIG_MMU into consideration.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 3 lines · Jens Axboe

It's a bit of a sledge hammer... Since get_user_pages() appears to work on nummu, we can just disable the vmsplice-to-userspace bits and leave the (working) vmsplice-from-userspace in place.

That sounds about right. I don't think you can do the latter without an MMU, but I may be wrong about what it does.

David

#3 lore raw
Quoted 8 lines · David Howells
Quoted 3 lines · Jens Axboe

It's a bit of a sledge hammer... Since get_user_pages() appears to work on nummu, we can just disable the vmsplice-to-userspace bits and leave the (working) vmsplice-from-userspace in place.

That sounds about right. I don't think you can do the latter without an MMU, but I may be wrong about what it does.

You mean the former? The latter is vmsplice() filling a pipe with user pages, using get_user_pages() to set them up. And that looks like it should work on nommu.

The former is vmsplice() using mmap like functionality to map pages into a user vma.

Just making sure we agree :-)

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 7 lines · Jens Axboe
Quoted 6 lines
Quoted 3 lines

It's a bit of a sledge hammer... Since get_user_pages() appears to work on nummu, we can just disable the vmsplice-to-userspace bits and leave the (working) vmsplice-from-userspace in place.

That sounds about right. I don't think you can do the latter without an MMU, but I may be wrong about what it does.

Quoted 6 lines

You mean the former? The latter is vmsplice() filling a pipe with user pages, using get_user_pages() to set them up. And that looks like it should work on nommu.

The former is vmsplice() using mmap like functionality to map pages into a user vma.

Sorry, yes. The former.

David