On Fri, Aug 04, 2023 at 09:48:18PM +0200, Jarom??r Dole??ek wrote: > > For the branch, I particularly disliked that there were quite a few > changes which looked either unrelated, or avoidable.
There should not have been any "unrelated" changes. I would not be surprised if there were changes that could have been avoided. It has been a very, very long time, but I think there are a few things worth noting that I discovered in the course of the work I did on this years ago. 1) It really is important to propagate maximum-transfer-size information down the bus hierarchy, because we have many cases where the same device could be connected to a different bus. 2) RAIDframe and its ilk are tough to get right, because there are many ugly corner cases such as someone trying to replace a failed component of a RAID set with a spare that is attached via a bus that has a smaller transfer size limit. Ensuring both that this doesn't happen and that errors are propagated back correctly is pretty hard. I have a vague recollection that this might be one source of the "unrelated" changes you mention. 3) With MAXPHYS increased to a very large value, we have filesystem code that can behave very poorly because it uses naive readahead or write clustering strategies that were only previously held in check by the 64K MAXPHYS limit. I didn't even make a start at handling this, honestly, and the aparrent difficult of getting it right is one reason I eventually decided I didn't have time to finish the work I started on the tls-maxphys branch. Beware! Don't trust linear-read or linear-write benchmarks that say your work in this area is done. You may have massacred performance for real world use cases other than your own. One thing we should probably do, if we have not already, is remove any ISA DMA devices and some old things like the wdc and pciide IDE attachments from the GENERIC kernels for ports like amd64, and then bump MAXPHYS to at least 128K, maybe 256K, for those kernels. Beyond that, though, I think you will quickly see the filesystem and paging misbehaviors I mention in #3 above. Thor