Computer Old Farts Forum
 help / color / mirror / Atom feed
* [COFF] Re: Terminology query - 'system process'?
@ 2023-12-20 19:31 Noel Chiappa
  2023-12-20 20:29 ` Paul Winalski
  2023-12-31  3:51 ` steve jenkin
  0 siblings, 2 replies; 22+ messages in thread
From: Noel Chiappa @ 2023-12-20 19:31 UTC (permalink / raw)
  To: coff; +Cc: jnc

    > From: Derek Fawcus

    > How early does that have to be? MP/M-1.0 (1979 spec) mentions this, as
    > "Resident System Processes" ... It was a banked switching, multiuser,
    > multitasking system for a Z80/8080.

Anything with a microprocessor is, by definition, late! :-)

I'm impressed, in retrospect, with how quickly the world went from proceesors
built with transistors, through proceesors built out discrete ICs, to
microprocessors. To give an example; the first DEC machine with an IC
processor was the -11/20, in 1970 (the KI10 was 1972); starting with the
LSI-11, in 1975, DEC started using microprocessors; the last PDP-11 with a
CPU made out of of discrete ICs was the -11/44, in 1979. All -11's produced
after that used microprocessors.

So just 10 years... Wow.

	Noel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [COFF] Re: Terminology query - 'system process'?
@ 2023-12-20 20:35 Noel Chiappa
  0 siblings, 0 replies; 22+ messages in thread
From: Noel Chiappa @ 2023-12-20 20:35 UTC (permalink / raw)
  To: coff; +Cc: jnc

    > the first DEC machine with an IC processor was the -11/20, in 1970

Clem has reminded me that the first was the PDP-8/I-L (the second was a
cost-reduced version of the -I), from. The later, and much more common,
PDP-8/E-F-M, were contemporaneous with the -11/20.

Oh well, only two years; doesn't really affect my main point. Just about
'blink and you'll miss them'!

	Noel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [COFF] Re: Terminology query - 'system process'?
@ 2023-12-14 23:29 Noel Chiappa
  2023-12-14 23:54 ` Larry McVoy
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Noel Chiappa @ 2023-12-14 23:29 UTC (permalink / raw)
  To: coff; +Cc: jnc

    > From: Bakul Shah

    > Now I'd probably call them kernel threads as they don't have a separate
    > address space.

Makes sense. One query about stacks, and blocking, there. Do kernel threads,
in general, have per-thread stacks; so that they can block (and later resume
exactly where they were when they blocked)?

That was the thing that, I think, made kernel processes really attractive as
a kernel structuring tool; you get code ike this (from V6):

	swap(rp->p_addr, a, rp->p_size, B_READ);
	mfree(swapmap, (rp->p_size+7)/8, rp->p_addr);

The call to swap() blocks until the I/O operation is complete, whereupon that
call returns, and away one goes. Very clean and simple code.

Use of a kernel process probably makes the BSD pageout daemon code fairly
straightforward, too (well, as straightforward as anything done by Berzerkly
was :-).


Interestingly, other early systems don't seem to have thought of this
structuring technique. I assumed that Multics used a similar technique to
write 'dirty' pages out, to maintain a free list. However, when I looked in
the Multics Storage System Program Logic Manual:

  http://www.bitsavers.org/pdf/honeywell/large_systems/multics/AN61A_storageSysPLM_Sep78.pdf

Multics just writes dirty pages as part of the page fault code: "This
starting of writes is performed by the subroutine claim_mod_core in
page_fault. This subroutine is invoked at the end of every page fault." (pg.
8-36, pg. 166 of the PDF.) (Which also increases the real-time delay to
complete dealing with a page fault.)

It makes sense to have a kernel process do this; having the page fault code
do it just makes that code more complicated. (The code in V6 to swap
processes in and out is beautifully simple.) But it's apparently only obvious
in retrospect (like many brilliant ideas :-).

	Noel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [COFF] Terminology query - 'system process'?
@ 2023-12-14 21:48 Noel Chiappa
  2023-12-14 22:06 ` [COFF] " Bakul Shah
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Noel Chiappa @ 2023-12-14 21:48 UTC (permalink / raw)
  To: coff; +Cc: jnc

So Lars Brinkhoff and I were chatting about daemons:

  https://gunkies.org/wiki/Talk:Daemon

and I pointed out that in addition to 'standard' daemons (e.g. the printer
spooler daemon, email daemon, etc, etc) there are some other things that are
daemon-like, but are fundamentally different in major ways (explained later
below). I dubbed them 'system processes', but I'm wondering if ayone knows if
there is a standard term for them? (Or, failing that, if they have a
suggestion for a better name?)


Early UNIX is one of the first systems to have one (process 0, the "scheduling (swapping)
process"), but the CACM "The UNIX Time-Sharing System" paper:

  https://people.eecs.berkeley.edu/~brewer/cs262/unix.pdf

doesn't even mention it, so no guidance there. Berkeley UNIX also has one,
mentioned in "Design and Implementation of the Berkeley Virtual Memory
Extensions to the UNIX Operating System":

  http://roguelife.org/~fujita/COOKIES/HISTORY/3BSD/design.pdf

where it is called the "pageout daemon".("During system initialization, just
before the init process is created, the bootstrapping code creates process 2
which is known as the pageout daemon. It is this process that .. writ[es]
back modified pages. The process leaves its normal dormant state upon being
waken up due to the memory free list size dropping below an upper
threshold.") However, I think there are good reasons to dis-favour the term
'daemon' for them.


For one thing, typical daemons look (to the kernel) just like 'normal'
processes: their object code is kept in a file, and is loaded into the
daemon's process when it starts, using the same mechanism that 'normal'
processes use for loading their code; daemons are often started long after
the kernel itself is started, and there is usually not a special mechanism in
the kernel to start daemons (on early UNIXes, /etc/rc is run by the 'init'
process, not the kernel); daemons interact with the kernel through system
calls, just like 'ordinary' processes; the daemon's process runs in 'user'
CPU mode (using the same standard memory mapping mechanisms, just like
blah-blah).

'System processes' do none of these things: their object code is linked into
the monolithic kernel, and is thus loaded by the bootstrap; the kernel
contains special provision for starting the system process, which start as
the kernel is starting; they don't do system calls, just call kernel routines
directly; they run in kernel mode, using the same memory mapping as the
kernel itself; etc, etc.

Another important point is that system processes are highly intertwined with
the operation of the kernel; without the system process(es) operating
correctly, the operation of the system will quickly grind to a halt. The loss
of ordinary' daemons is usually not fatal; if the email daemon dies, the
system will keep running indefinitely. Not so, for the swapping process, or
the pageout daemon


Anyway, is there a standard term for these things? If not, a better name than
'system process'?

	Noel

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

end of thread, other threads:[~2023-12-31  3:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 19:31 [COFF] Re: Terminology query - 'system process'? Noel Chiappa
2023-12-20 20:29 ` Paul Winalski
2023-12-31  3:51 ` steve jenkin
  -- strict thread matches above, loose matches on Subject: below --
2023-12-20 20:35 Noel Chiappa
2023-12-14 23:29 Noel Chiappa
2023-12-14 23:54 ` Larry McVoy
2023-12-15  1:15 ` Bakul Shah
2023-12-15 17:51   ` Paul Winalski
2023-12-15 18:08     ` Warner Losh
2023-12-16  2:04     ` Greg 'groggy' Lehey
2023-12-16 19:21       ` Paul Winalski
2023-12-16 19:44         ` Paul Winalski
2023-12-15 13:43 ` Dan Cross
2023-12-19 13:54 ` Derek Fawcus via COFF
2023-12-14 21:48 [COFF] " Noel Chiappa
2023-12-14 22:06 ` [COFF] " Bakul Shah
2023-12-14 22:12   ` Warner Losh
2023-12-14 22:09 ` Clem Cole
2023-12-15 14:20   ` Dan Cross
2023-12-15 16:25     ` Warner Losh
2023-12-15 17:13     ` Bakul Shah
2023-12-15  6:24 ` Lars Brinkhoff
2023-12-15 18:30   ` Stuff Received

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).