All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: A reduced Linux network stack for small systems
@ 2014-05-05 22:25 Andi Kleen
  2014-05-05 22:25 ` [PATCH 01/24] net, diet: Reduce netdev name hash table for CONFIG_BASE_SMALL Andi Kleen
                   ` (25 more replies)
  0 siblings, 26 replies; 124+ messages in thread
From: Andi Kleen @ 2014-05-05 22:25 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, tom.zanussi

There has been a lot of interest recently to run Linux on very small systems,
like Quark systems. These may have only 2-4MB memory. They are also limited
by flash space.

One problem on these small system is the size of the network stack.
Currently enabling IPv4 costs about 400k in text, which is prohibitive on
a 2MB system, and very expensive with 4MB.

There were proposals to instead use LWIP in user space. LWIP with 
its socket interface comes in at a bit over 100k overhead per application.

I maintain that the Linux network stack is actually not that bloated,
it just has a lot of features :-)  The goal of this project was to
subset it in a sensible way so that the native kernel stack becomes
competitive with LWIP.

It turns out that the standard stack has a couple of features that
are not really needed on client systems. Luckily it is also 
relatively well modularized, so it becomes possible to stub
out these features at the edge.

With removing these features we still have a powerful TCP/IP stack,
but one that fits better into small systems.

It would have been prohibitive to ifdef every optional feature.
This patchkit relies heavily on LTO to effectively remove unused
code. This allows to disable features only at the module boundaries,
and rely on the compiler to drop unreferenced code and data.

A few features have been also reimplemented in a simpler way.
And I shrank a number of data structures based on CONFIG_BASE_SMALL.

With these changes I can get a fully featured network stack down
to about 170k with LTO. Without LTO there are also benefits,
but somewhat less.

There are essentially three sensible configurations:
- Full featured like today.
- Client only subset, but still works with standard distribution userland.
Remove some obscure features like fastopen, make all tables smaller, 
packet socket mmap code, use a simpler routing table, remove
high speed networking features like RPX, XPS, GRO offload. 
Disable SNMP, TCP metrics
- Minimal subset for deeply embedded systems that can use special userland.
Remove rtnetlink (ioctl only), remove ethtool, raw sockets.

Right now I'm using own Kconfigs for every removed features. I realize
this somewhat increases the compile test matrix. It would be possible
to hide some of the options and select them using higher level
configurations like the ones listed above. I haven't done this
in this version.

At this point I'm mainly interested in review and comments.

Git trees:

git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc net/debloat
Main tree

git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc net/debloat-3.14
3.14 based tree.

Thanks to Tom Zanussi for contributions and testing.

Andi Kleen

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

end of thread, other threads:[~2014-06-23 10:18 UTC | newest]

Thread overview: 124+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-05 22:25 RFC: A reduced Linux network stack for small systems Andi Kleen
2014-05-05 22:25 ` [PATCH 01/24] net, diet: Reduce netdev name hash table for CONFIG_BASE_SMALL Andi Kleen
2014-05-06  3:03   ` David Miller
2014-05-05 22:25 ` [PATCH 02/24] net, diet: Reduce NAPI " Andi Kleen
2014-05-05 22:25 ` [PATCH 03/24] net, diet: Decrease ip defrag hash tables and max length with BASE_SMALL Andi Kleen
2014-05-05 22:25 ` [PATCH 04/24] net, diet: Make FIB hash tables smaller with CONFIG_BASE_SMALL Andi Kleen
2014-05-06  3:10   ` David Miller
2014-05-05 22:25 ` [PATCH 05/24] net, diet: Default to small TCP hash tables on small kernels Andi Kleen
2014-05-06  3:12   ` David Miller
2014-05-05 22:25 ` [PATCH 06/24] net, diet: Use small UDP " Andi Kleen
2014-05-06  3:11   ` David Miller
2014-05-06 14:26   ` Eric Dumazet
2014-05-06 18:23     ` Andi Kleen
2014-05-06 19:25       ` Eric Dumazet
2014-05-05 22:25 ` [PATCH 07/24] net, diet: Make ping sockets optional Andi Kleen
2014-05-06  3:04   ` David Miller
2014-05-05 22:25 ` [PATCH 08/24] net, diet: Make TCP metrics optional Andi Kleen
2014-05-05 23:18   ` Yuchung Cheng
2014-05-05 23:28     ` Andi Kleen
2014-05-06  3:12   ` David Miller
2014-05-06  3:21     ` Andi Kleen
2014-05-06  3:23       ` David Miller
2014-05-06  4:39         ` Tom Zanussi
2014-05-07 13:59           ` One Thousand Gnomes
2014-05-07 17:20             ` David Miller
2014-05-07 22:19               ` Tim Bird
2014-05-07 22:52                 ` David Miller
2014-05-06 15:57         ` josh
2014-05-06 15:59           ` David Miller
2014-05-06 16:41             ` josh
2014-05-06 17:12               ` Rick Jones
2014-05-06 18:09                 ` josh
2014-05-06 17:16               ` David Miller
2014-05-06 17:55                 ` josh
2014-05-06 18:33                   ` Cong Wang
2014-05-06 18:48                     ` Andi Kleen
2014-05-06 19:19                     ` Richard Cochran
2014-05-06 20:44                     ` David Miller
2014-05-06 21:08                       ` josh
2014-05-06 21:11                         ` David Miller
2014-05-06 22:50                           ` josh
2014-05-06 23:27                             ` Eric Dumazet
2014-06-14 20:33                     ` Pavel Machek
2014-06-23 10:17                     ` zhuyj
2014-05-06 19:14               ` Richard Cochran
2014-05-06 19:50                 ` Andi Kleen
2014-05-06 20:07                   ` Richard Cochran
2014-05-06 21:05                     ` Andi Kleen
2014-05-06 23:29                       ` Eric Dumazet
2014-05-07  4:33                         ` Andi Kleen
2014-05-06 20:46                   ` David Miller
2014-05-07  8:39               ` David Laight
2014-05-09  9:48             ` Pavel Machek
2014-05-06 16:39           ` Eric Dumazet
2014-05-06 16:45             ` josh
2014-05-06 17:03               ` Eric Dumazet
2014-05-06 17:30                 ` josh
2014-05-06 17:17               ` David Miller
2014-05-06 17:21                 ` josh
2014-05-06 17:25                   ` David Miller
2014-05-06 20:06                     ` Andi Kleen
2014-05-06 20:47                       ` David Miller
2014-05-06 20:11                     ` josh
2014-05-06 20:44                       ` Andi Kleen
2014-05-06 17:14             ` David Miller
2014-05-06 18:32             ` Andi Kleen
2014-05-06 18:58               ` Tom Herbert
2014-05-06 19:37                 ` josh
2014-05-06 19:57                 ` Andi Kleen
2014-05-06 20:17               ` Eric Dumazet
2014-05-06 20:27                 ` josh
2014-05-06 20:37                 ` Andi Kleen
2014-05-06 20:48                 ` David Miller
2014-05-07 13:35                 ` One Thousand Gnomes
2014-05-13 16:22                   ` Christer Weinigel
2014-05-09  7:38     ` Pavel Machek
2014-05-05 22:25 ` [PATCH 09/24] net, diet: Make ethtool optional Andi Kleen
2014-05-06  3:11   ` David Miller
2014-05-06  3:14     ` Andi Kleen
2014-05-06  3:22       ` David Miller
2014-05-05 22:25 ` [PATCH 10/24] net, diet: Make LPF filter optional Andi Kleen
2014-05-06  3:10   ` David Miller
2014-05-05 22:26 ` [PATCH 11/24] net, diet: Move rtnl_lock to separate file Andi Kleen
2014-05-05 22:26 ` [PATCH 12/24] net, diet: Make rtnetlink optional Andi Kleen
2014-05-06  3:08   ` David Miller
2014-05-06  3:11     ` Andi Kleen
2014-05-05 22:26 ` [PATCH 13/24] net, diet: Make GRO offload optional Andi Kleen
2014-05-06  3:01   ` David Miller
2014-05-06  3:03     ` Andi Kleen
2014-05-05 22:26 ` [PATCH 14/24] net, diet: Make MIB statistics collections depend on PROC_FS Andi Kleen
2014-05-06  3:05   ` David Miller
2014-05-05 22:26 ` [PATCH 15/24] net, diet: Make igmp and mcast ioctls depend on IP_MULTICAST Andi Kleen
2014-05-05 22:26 ` [PATCH 16/24] net, diet: Make TCP fastopen optional Andi Kleen
2014-05-06  3:06   ` David Miller
2014-05-05 22:26 ` [PATCH 17/24] net, diet: Make internal control sockets use UDP Andi Kleen
2014-05-05 22:26 ` [PATCH 18/24] net, diet: Make raw sockets optional Andi Kleen
2014-05-06  3:12   ` David Miller
2014-05-05 22:26 ` [PATCH 19/24] net, diet: Make RPS configurable Andi Kleen
2014-05-06  3:14   ` David Miller
2014-05-06  3:16     ` Andi Kleen
2014-05-06  8:32   ` Bjørn Mork
2014-05-05 22:26 ` [PATCH 20/24] net, diet: Make XPS configurable Andi Kleen
2014-05-05 22:26 ` [PATCH 21/24] net, diet: Make packet tpacket/mmap/fanout/rings optional Andi Kleen
2014-05-06  3:09   ` David Miller
2014-05-05 22:26 ` [PATCH 22/24] net, diet: Support simpler routing table Andi Kleen
2014-05-06  3:02   ` David Miller
2014-05-06  3:08     ` Andi Kleen
2014-05-06  3:21       ` David Miller
2014-05-05 22:26 ` [PATCH 23/24] net, diet: Add coccinelle script to convert drivers to ETHTOOL_OPS Andi Kleen
2014-05-06  9:27   ` Nicolas Palix
2014-05-06 15:05     ` David Miller
2014-05-07  0:18       ` Wilfried Klaebe
2014-05-05 22:26 ` [PATCH 24/24] net, diet: Convert all drivers to use SET_ETHTOOL_OPS Andi Kleen
2014-05-06  7:25 ` RFC: A reduced Linux network stack for small systems Richard Weinberger
2014-05-06 13:34   ` Tom Zanussi
2014-05-06 15:20     ` Alexei Starovoitov
2014-05-06 15:34       ` Tom Zanussi
2014-05-06 17:20         ` Alexei Starovoitov
2014-05-06 20:00           ` Andi Kleen
2014-05-06 21:05             ` Alexei Starovoitov
2014-05-09  7:39           ` Pavel Machek
2014-05-09  7:38       ` Pavel Machek
2014-05-06  9:18 ` David Laight
2014-05-07 13:20   ` One Thousand Gnomes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.