|
|
Log in / Subscribe / Register

Pulling slabs out of struct page

Pulling slabs out of struct page

Posted Oct 8, 2021 21:12 UTC (Fri) by willy (subscriber, #9762)
In reply to: Pulling slabs out of struct page by abatters
Parent article: Pulling slabs out of struct page

TBAA is unsuited to kernel development.

https://www.yodaiken.com/2021/10/06/plos-2021-paper-how-i...


to post comments

Pulling slabs out of struct page

Posted Oct 10, 2021 7:03 UTC (Sun) by dvdeug (subscriber, #10998) [Link] (9 responses)

It's certainly <i>an</i> article. Starting with lines like "The C programming language [33] is the first, and, so far,only widely successful programming language that provides operating system developers with a high-level language alternative to assembler (compare to [42])"? BLISS, PL/I and Algol 68 all were used as implementation languages for OSes released before Unix, and afterwards, any number of languages have been used, with "only widely successful" coming off as a weaselly way of saying "most widely successful".

It concludes with "A small performance improvement will generally not justify a decrease in code stability for operating systems...", but as I see it, that's not supported by reality; stuff like https://lwn.net/Articles/871726/ makes it clear Linux kernel programmers will write to conventions no C compiler ever has promised they won't break (multiprocessing largely postdates ISO C) for a speedup. My guess is that if kernel developers got a -kernel switch that gave them everything they claimed to want at the cost of an average of 15% loss in performance, they'd be up in arms.

In any case, all the article really says about "TBAA is unsuited to kernel development." is "it may be possible in ISO C to push all these different types into a union, but that would harm modularity,..." Given that C is about the only language in modern use not to have a module or package system (showing a lack of commitment to modularity) and we're talking about a direct hit to code stability, I'm not overwhelmed by that argument.

Pulling slabs out of struct page

Posted Oct 10, 2021 18:20 UTC (Sun) by Wol (subscriber, #4433) [Link] (6 responses)

> with "only widely successful" coming off as a weaselly way of saying "most widely successful".

How many successful operating systems have been written in C? Two? Unix of course, I don't know what language Windows was written in, but I suspect most of it is C nowadays if it wasn't to start with?

To my knowledge Multics predates C - Fortran? Pr1mos was a multics-derivative - that was Fortran, then they ADDED PL/? (is that PL/1, PL/P, SPL, ... a whole bundle of variants/dialects/whatever). Then they TRIED to port the whole shebang to C and the result was a disaster.

How many other OS ports to C have been a disaster? I strongly suspect C owes its success to Unix, NOT the other way round.

Cheers,
Wol

Pulling slabs out of struct page

Posted Oct 10, 2021 19:58 UTC (Sun) by mpr22 (subscriber, #60784) [Link]

C and Unix's success is mutualistic.

The 1973 rewrite of Unix from PDP-11 assembly to C would eventually allow it to proliferate off of DEC hardware (the first such port being to the Interdata 8/32 in 1978); Unix succeeding, in turn, allowed C to proliferate off of Unix.

Pulling slabs out of struct page

Posted Oct 11, 2021 6:47 UTC (Mon) by dvdeug (subscriber, #10998) [Link] (2 responses)

It depends on what we call successful and operating system, doesn't it. Windows and most forms of Un*x have kernels written primarily in C. (Windows 3.0 apparently rewrote a bunch of stuff from C into assembly.) MacOS X and Windows NT kernels have some C++, especially at the edges. It's hard to tell for many, but C and C++ seem to dominate, with other programming languages now for one-offs or research.

MacOS seems to have drifted through assembly, Pascal, and then C. Multics was PL/I. PRIMOS was originally Fortran IV, then a PL/1 dialect and Modula-2.

I tend to agree with mpr22 that Unix and C's success were mutual. If nothing else, the Lions book offered a good example of what could be done, and how to do it in C, and Ada and ALGOL-68 were complex, Modula-2 and LISP too academic and not specifically designed for it, PASCAL way too academic and not designed for it, except in a horde of dialects, and BLISS, JOVIAL and PL/S too proprietary and ill-documented. Unix could have won and eventually been rewritten in Modula-2 or something else, had C not been at least good enough.

Pulling slabs out of struct page

Posted Oct 11, 2021 12:36 UTC (Mon) by pizza (subscriber, #46) [Link]

>It depends on what we call successful and operating system, doesn't it.

Don't forget various RTOSes and other embedded stuff -- C (and to a lesser extent, C++) overwhelmingly dominate.

Rust has some promise to supplant things there, but the amount of unsafe boilerplate needed to drive a modern MCU is staggering. Some of that can be automated away but it results in a much steeper curve to being productive.

Pulling slabs out of struct page

Posted Oct 13, 2021 19:36 UTC (Wed) by NYKevin (subscriber, #129325) [Link]

> Windows and most forms of Un*x have kernels written primarily in C. (Windows 3.0 apparently rewrote a bunch of stuff from C into assembly.)

This is true, but Microsoft historically has not made a very strong effort to distinguish between "the kernel" and "the rest of Windows." To some extent, this is an arbitrary line-drawing exercise. For example, you could take the position that every process which runs as SYSTEM is the Windows equivalent of a kernel thread, and therefore large chunks of the Windows kernel are actually written in managed languages like C#, but I imagine some people would violently disagree with that characterization.

Pulling slabs out of struct page

Posted Jan 20, 2022 22:17 UTC (Thu) by yodaiken (guest, #156253) [Link]

Pulling slabs out of struct page

Posted Jan 20, 2022 23:05 UTC (Thu) by anselm (subscriber, #2796) [Link]

To my knowledge Multics predates C - Fortran?

According to multicians.org, PL/1, or specifically a subset thereof called EPL.

Pulling slabs out of struct page

Posted Jan 15, 2022 22:31 UTC (Sat) by yodaiken (guest, #156253) [Link] (1 responses)

"Starting with lines like "The C programming language [33] is the first, and, so far,only widely successful programming language that provides operating system developers with a high-level language alternative to assembler (compare to [42])"? BLISS, PL/I and Algol 68 all were used as implementation languages for OSes released before Unix, ..."

See that "(compare to [42])" ? That is a citation. If you look on the bottom of the article you can find

42]William A Wulf. 1972. Systems for systems implementors: some experiences from Bliss. In Proceedings of the December 5-7, 1972, fall joint computer conference, part II. 943–948.

As for Pl/1 and Algol68, I'd love to see references to actual operating systems implemented in either. The Bliss article is interesting and perhaps you should read it.

Thanks for calling my paper "weaselly" though. Impressive criticism.

Pulling slabs out of struct page

Posted Jan 16, 2022 1:29 UTC (Sun) by mgb (guest, #3226) [Link]

I never used it and had no part in it's implementation but I did stand next to the CAP computer once. It had an ALGOL 68C OS.

https://en.wikipedia.org/wiki/CAP_computer


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds