On Sat, Feb 03, 2018 at 06:14:30PM -0700, Warner Losh wrote:
Linux and FreeBSD are now two monstrous trolls,
bloated and extremely
complex and large.
Looking through /usr/include/***.h, I see:
FreeBSD 10.4: #define SYS_MAXSYSCALL 548
MacOS Sierra: #define SYS_MAXSYSCALL 522
Debian 8.10: I don't know where the Penguins have hidden it...
Part of the reason for the bloat is that newer syscalls replace older ones
(with the option for keeping the older one around for compat). So, open
becomes openat (since the latter is more expressive). Also, over time,
different data types grow to allow, for example, larger than 2G files,
which has a big ripple effect on lots of system calls. But looking now, a
lot are due to MAC and ACL functions (well, 30). There's 80 'at' system
calls (though some are in the ~150 obsolete list)... So it isn't as utterly
horrific as it might sound, but it's still pretty bad. (There's 400
defined, with 20 of those being for prior versions of the OS).
Indeed. Linux has 292 system calls as of Linux 4.15. If you include
the backwards compatibility system calls, the number of system calls
goes up to 352.
Of course, just comparing system calls isn't really the whole story.
There are also system interfaces via /proc and /sys, ioctl's, etc.
(And by that measure Plan9 has a lot of complexity that doesn't show
up in plain system call counts.)
*And* of course, a lot of bloat doesn't show up in kernel/userspace
interfaces, but rather in the complexity that people expect to be
found in modern Systems, whether they be in the kernel or in the Java
class libraries, etc. Complaining about the OS complexity when people
are gleefully building super-complex systems in userspace seems to me
to be a kind of "get off my lawn" complaint.
The question is, given an overall system architecture, *including*
userspace, when does it make sense to try to simplify things by
pushing some of the work to the lower layers of the software stack,
and when does it make sense to force the userspace to deal with the
complexity?
Of course, if you want to do all of your programming on the equivalent
of a Raspberry Pi, that also can be your choice. :-)
- Ted