Conversation
Edited 1 month ago
init_task is not the task_struct of the init process but of the swapper process.
It confuses me every time.
1
0
3
@hyeyoo I wish it was called differently, I've recently had to explain it's not a process doing memory reclaim...
2
0
1
@vbabka ....yeah it does not even perform 'swapping' despite its name
1
0
2
@hyeyoo IIRC the name comes historically from swapping processes to be run on the CPU, which we'd call scheduling now, and swapping has a mm specific meaning
1
1
4
Edited 1 month ago
@vbabka

Yeah and even worse, when mm people say 'swapping,' they usually mean 'paging'...
2
0
2
@hyeyoo @vbabka I was going to say "[writeback]" doesn't actually do the writeback, that's the emergency ('rescue') writeback kernel process but then I checked and that's been changed :0 so now it's [kworker/R-writeback] where R means rescue...
3
0
3
@hyeyoo @vbabka (as an example of a 'confusing' thing)
1
0
1
@hyeyoo @vbabka the rest of writeback is obviously super simple. *ahem*
0
0
2
@ljs @vbabka There should really be a committee dedicated to naming things….
1
0
2
@hyeyoo @vbabka they could look at madvise names to start with
1
0
2
@ljs @hyeyoo doesn't work, there was a whole committee proposing poison/remedy but got overriden by just two unfunny people :(
0
0
2
@ljs @hyeyoo maybe even the name swapper could be changed then, to e.g. idler?
2
0
2

@vbabka @hyeyoo @ljs Can you think of any fallout for userspace if this gets renamed?

2
0
2
@oleksandr @hyeyoo @ljs unfortunately, yes, I wouldn't be surprised at all by monitoring tools breaking subtly if the idle process is renamed.
1
1
0

@vbabka @hyeyoo @ljs this reminds me of a "what is pid 0" blogpost by @danderson i read a while ago: https://blog.dave.tf/post/linux-pid0/
"It was called that because, now that we’re back at the beginning of Unix, one routine encompasses not only scheduling and idling, but also moving entire process memory images between the small core memory and secondary storage. Hard drives in this case[...]"

0
1
2
@oleksandr @hyeyoo @ljs it would be basically as risky as changing an uapi header so that it breaks with a c89 compiler
1
2
1

@hyeyoo @vbabka wondering how much from this comes from unix and bsd. unix originally had a pid 0 swapper process that swapped whole processes -- their userspace memory and half of their kernel structure -- onto the swap devices. bsd retained this while they also added a separate capability to move individual pages to swap device. they also still retained the split of kernel process bookkeeping data into two structures -- the swappable and the nonswappable part.

1
0
1
@lkundrak @hyeyoo @vbabka funny, because nearly everybody swapped out bsd for linux also
1
1
2

@ljs @hyeyoo @vbabka not before they could cause irrepairable damage to unix with introduction of their networking api, symbolic links, ptys and similar abominations

0
0
2

@vbabka @hyeyoo another terrible name I've had to explain multiple times is struct address_space

1
0
2

@osandov @vbabka @hyeyoo struct address_space is a terrible thing on its own even if we ignore its name for a moment

0
0
2