Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)

5 messages, 4 authors, 2014-11-24 · open the first message on its own page

Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)

From: Josh Triplett <hidden>
Date: 2014-11-23 19:43:26

On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
Truly removing sendfile/sendpage means that you can't even compile NFS
into the tree.
If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
stack of "select" and "depends on", both directly and indirectly; adding
a "select SPLICE_SYSCALL" to it seems fine.  (That select does need
adding, though.  Pieter, you need to test-compile more than just
tinyconfig and defconfig.  Try an allyesconfig with *just* splice turned
off, and make sure that compiles.)

Given the requirements of running a file server in the kernel, I'd
expect CONFIG_NFSD to end up with several more selects of optional
functionality in the future.  It seems rather likely that the average
embedded system will be compiling out NFS. :)

Also, this patch series compiles out splice and sendfile, including
several *users* of sendpage; it doesn't compile out the sendpage
support/infrastructure itself.

- Josh Triplett

Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)

From: Pieter Smith <hidden>
Date: 2014-11-23 20:30:40

On Sun, Nov 23, 2014 at 11:43:26AM -0800, Josh Triplett wrote:
On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
quoted
Truly removing sendfile/sendpage means that you can't even compile NFS
into the tree.
If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
stack of "select" and "depends on", both directly and indirectly; adding
a "select SPLICE_SYSCALL" to it seems fine.  (That select does need
adding, though.  Pieter, you need to test-compile more than just
tinyconfig and defconfig.  Try an allyesconfig with *just* splice turned
off, and make sure that compiles.)
Did exacly that. Took forever on my hardware, but no problems.
Given the requirements of running a file server in the kernel, I'd
expect CONFIG_NFSD to end up with several more selects of optional
functionality in the future.  It seems rather likely that the average
embedded system will be compiling out NFS. :)

Also, this patch series compiles out splice and sendfile, including
several *users* of sendpage; it doesn't compile out the sendpage
support/infrastructure itself.

- Josh Triplett

Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)

From: Josh Triplett <hidden>
Date: 2014-11-23 23:36:37

On Sun, Nov 23, 2014 at 09:30:40PM +0100, Pieter Smith wrote:
On Sun, Nov 23, 2014 at 11:43:26AM -0800, Josh Triplett wrote:
quoted
On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
quoted
Truly removing sendfile/sendpage means that you can't even compile NFS
into the tree.
If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
stack of "select" and "depends on", both directly and indirectly; adding
a "select SPLICE_SYSCALL" to it seems fine.  (That select does need
adding, though.  Pieter, you need to test-compile more than just
tinyconfig and defconfig.  Try an allyesconfig with *just* splice turned
off, and make sure that compiles.)
Did exacly that. Took forever on my hardware, but no problems.
Ah, I see.  Looking more closely at nfsd, it looks like it already has a
code path for filesystems that don't do splice.  I think, rather than
making nfsd select SPLICE_SYSCALL, that it would suffice to change the
"rqstp->rq_splice_ok = true;" in svc_process_common (net/sunrpc/svc.c)
to:

rqstp->rq_splice_ok = IS_ENABLED(CONFIG_SPLICE_SYSCALL);

Then nfsd should simply *always* fall back to its non-splice support.

That said, given that it seems exceedingly unlikely that anyone would
use the in-kernel nfsd on a system trying to minimize kernel size, it
still seems cleaner to just "select SPLICE_SYSCALL" from NFSD in
Kconfig.  That avoids making any changes at all to the nfsd source in
this patch series.

- Josh Triplett

Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)

From: Jeff Layton <hidden>
Date: 2014-11-24 00:28:10

On Sun, 23 Nov 2014 15:36:37 -0800
Josh Triplett [off-list ref] wrote:
On Sun, Nov 23, 2014 at 09:30:40PM +0100, Pieter Smith wrote:
quoted
On Sun, Nov 23, 2014 at 11:43:26AM -0800, Josh Triplett wrote:
quoted
On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
quoted
Truly removing sendfile/sendpage means that you can't even compile NFS
into the tree.
If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
stack of "select" and "depends on", both directly and indirectly; adding
a "select SPLICE_SYSCALL" to it seems fine.  (That select does need
adding, though.  Pieter, you need to test-compile more than just
tinyconfig and defconfig.  Try an allyesconfig with *just* splice turned
off, and make sure that compiles.)
Did exacly that. Took forever on my hardware, but no problems.
Ah, I see.  Looking more closely at nfsd, it looks like it already has a
code path for filesystems that don't do splice.  I think, rather than
making nfsd select SPLICE_SYSCALL, that it would suffice to change the
"rqstp->rq_splice_ok = true;" in svc_process_common (net/sunrpc/svc.c)
to:

rqstp->rq_splice_ok = IS_ENABLED(CONFIG_SPLICE_SYSCALL);

Then nfsd should simply *always* fall back to its non-splice support.
I'd probably prefer the above, actually. We have to keep supporting
non-splice enabled fs' for the forseeable future, so we may as well
allow people to run nfsd in such configurations. It could even be
useful for testing the non-splice-enabled codepaths.
That said, given that it seems exceedingly unlikely that anyone would
use the in-kernel nfsd on a system trying to minimize kernel size, it
still seems cleaner to just "select SPLICE_SYSCALL" from NFSD in
Kconfig.  That avoids making any changes at all to the nfsd source in
this patch series.
-- 
Jeff Layton [off-list ref]

Re: [PATCH 0/6] kernel tinification: optionally compile out splice family of syscalls (splice, vmsplice, tee and sendfile)

From: Geert Uytterhoeven <hidden>
Date: 2014-11-24 08:38:20

On Mon, Nov 24, 2014 at 12:36 AM, Josh Triplett [off-list ref] wrote:
On Sun, Nov 23, 2014 at 09:30:40PM +0100, Pieter Smith wrote:
quoted
On Sun, Nov 23, 2014 at 11:43:26AM -0800, Josh Triplett wrote:
quoted
On Sun, Nov 23, 2014 at 01:46:23PM -0500, David Miller wrote:
quoted
Truly removing sendfile/sendpage means that you can't even compile NFS
into the tree.
If you mean the in-kernel nfsd (CONFIG_NFSD), that already has a large
stack of "select" and "depends on", both directly and indirectly; adding
a "select SPLICE_SYSCALL" to it seems fine.  (That select does need
adding, though.  Pieter, you need to test-compile more than just
tinyconfig and defconfig.  Try an allyesconfig with *just* splice turned
off, and make sure that compiles.)
Did exacly that. Took forever on my hardware, but no problems.
Ah, I see.  Looking more closely at nfsd, it looks like it already has a
code path for filesystems that don't do splice.  I think, rather than
making nfsd select SPLICE_SYSCALL, that it would suffice to change the
"rqstp->rq_splice_ok = true;" in svc_process_common (net/sunrpc/svc.c)
to:

rqstp->rq_splice_ok = IS_ENABLED(CONFIG_SPLICE_SYSCALL);

Then nfsd should simply *always* fall back to its non-splice support.
Hence I suggest adding to the nfsd help text:

    While nfsd works without SPLICE_SYSCALL, you may want to enable
    SPLICE_SYSCALL for <...> (performance?) reasons.

(Hmm, does Kconfig need a "suggests", cfr. Debian package dependencies?)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help