Contributed by pitrh on from the ever hack a kiwi? dept.
I had come to Dunedin with a possible fix for an annoying threading bug in the kernel ptracing code. It's a bit complicated in the locking of the single-threading logic, and I wanted to see what kettenis@ thought about it. I noted a second problem (tsleep being called recursively) which was "easy to fix", so I started on that and discovered that it was, of course, much more complicated then I expected. Trying to work out how to fix *that* led to the subtle tangle which is exit1(). So I worked on simplifying the exit logic so that exiting threads in multi-threaded processes completely skip the zombie and wait logic. Most of that went in early; as I write this there's one last change to remove the "alternate exit signal" support for Linux compat, as it's unused by modern programs.
With that so frustrating, I flipped for a while over to understanding the ACPI requiremnts on C-state transitions. I had added support back in the fall for using the MWAIT instruction on i386 and amd64 in the idle loop and want to have it use the higher C-states (C2, C3, etc) when available. mlarkin@ however had pointed out that you should only request those states from MWAIT if the ACPI _CST table said to do so, so I dumped that info on a few laptops and poked at the documentation of the format. I'm now trying to decide how best to pass the information from the acpicpu driver down to the MD idle loop code. Once I settle on that I'll float a diff and we'll see which machines it barfs on.
kettenis@ had recently completed the transition of the C startup code (csu) and ld.so to passing the ld.so cleanup function in the ABI specified fashion. With that done, the next advance is to have ld.so and csu handle the allocation and initialization of the initial thread's Thread Control Block (TCB). I had already sketched out what I desired of the layout of this, with the pthread_t structured placed in the same allocation, so I spent a day working through the necessary code to do this, with enough transition code in libpthread to work both ways. That needs a lot more testing as there are MD changes in the cerror ASM so it's not going to make the release 5.5, but it should enable some simplifications and is a step towards support for the __thread storage specifier.
In discussions about structure padding we realized that there was some dangling work from the big-time_t change: some of the syscalls that passed timevals and timespecs could carry data in the padding between processes or from the kernel to userspace, so I worked through the various system calls and changed several to zero fill the structures and copy the time structures memberwise to avoid copying out data in padding. Other sundry changes: manpage tweaks discussed with schwarze@ and others, an rusage accumulation missing that tedu@ reported, a gcc temp file cleanup bug seen in release builds, and more assertions in the kernel synchronization code.
Many thanks to Jim Cheetham and the University of Otago for hosting us again, despite knowing what to expect!
Thank you, Philip, for the good work and for submitting this report!
We hear there are more n2k14 reports incoming, watch this space for more!
(Comments are closed)