public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm] splice: Disable vmsplice on nommu.
@ 2007-09-11  8:23 Paul Mundt
  2007-09-11  9:35 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Mundt @ 2007-09-11  8:23 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jens Axboe, David Howells, Greg Ungerer, linux-kernel

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.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

--

 fs/splice.c     |    2 ++
 kernel/sys_ni.c |    1 +
 2 files changed, 3 insertions(+)

--- linux-2.6.23-rc4-mm1.orig/fs/splice.c	2007-09-11 15:15:54.000000000 +0900
+++ linux-2.6.23-rc4-mm1/fs/splice.c	2007-09-11 17:11:02.000000000 +0900
@@ -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,
--- linux-2.6.23-rc4-mm1.orig/kernel/sys_ni.c	2007-09-11 15:15:56.000000000 +0900
+++ linux-2.6.23-rc4-mm1/kernel/sys_ni.c	2007-09-11 17:09:24.000000000 +0900
@@ -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);
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -mm] splice: Disable vmsplice on nommu.
  2007-09-11  8:23 [PATCH -mm] splice: Disable vmsplice on nommu Paul Mundt
@ 2007-09-11  9:35 ` Jens Axboe
  2007-09-11 10:10   ` David Howells
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2007-09-11  9:35 UTC (permalink / raw)
  To: Paul Mundt, Andrew Morton, David Howells, Greg Ungerer,
	linux-kernel

On Tue, Sep 11 2007, Paul Mundt wrote:
> 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.

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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -mm] splice: Disable vmsplice on nommu.
  2007-09-11  9:35 ` Jens Axboe
@ 2007-09-11 10:10   ` David Howells
  2007-09-11 11:25     ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: David Howells @ 2007-09-11 10:10 UTC (permalink / raw)
  To: Jens Axboe
  Cc: dhowells, Paul Mundt, Andrew Morton, Greg Ungerer, linux-kernel

Jens Axboe <jens.axboe@oracle.com> wrote:

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -mm] splice: Disable vmsplice on nommu.
  2007-09-11 10:10   ` David Howells
@ 2007-09-11 11:25     ` Jens Axboe
  2007-09-11 16:57       ` David Howells
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2007-09-11 11:25 UTC (permalink / raw)
  To: David Howells; +Cc: Paul Mundt, Andrew Morton, Greg Ungerer, linux-kernel

On Tue, Sep 11 2007, David Howells wrote:
> Jens Axboe <jens.axboe@oracle.com> wrote:
> 
> > 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 :-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -mm] splice: Disable vmsplice on nommu.
  2007-09-11 11:25     ` Jens Axboe
@ 2007-09-11 16:57       ` David Howells
  0 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2007-09-11 16:57 UTC (permalink / raw)
  To: Jens Axboe
  Cc: dhowells, Paul Mundt, Andrew Morton, Greg Ungerer, linux-kernel

Jens Axboe <jens.axboe@oracle.com> wrote:

> > > 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.

Sorry, yes.  The former.

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-11 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-11  8:23 [PATCH -mm] splice: Disable vmsplice on nommu Paul Mundt
2007-09-11  9:35 ` Jens Axboe
2007-09-11 10:10   ` David Howells
2007-09-11 11:25     ` Jens Axboe
2007-09-11 16:57       ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox