Sunday, April 15, 2012

All TTY Drivers to Have tty_port

So the second pile of TTY patches have been accepted…

And now, the most of drivers in the tree was augmented to operate with tty_port structure. The only few remaining will be changed in the next merge window (a month or so). After that, every out-of-tree driver will be broken unless it is fixed right now. You have been warned.

One might ask, why we are doing this change? The answer is simple: The code is broken. Some of the code predates Linux 1.0. Yes, it is no argument, but you know what? It is full of ancient broken code designed originally for uniprocessor, no preemption and such. Thus there are many race conditions without any real chance to fix them in the state the code stands now.

And yet, Big-Kernel-Lock (BKL). You heard that it is gone from the kernel for some time already, right? No, it is not. It is still there. Some parts of the kernel still have left-overs from this ancient coarse-grained crap. In TTY, it is called Big-TTY-Mutex. And nobody really knows what is protected by the lock (and what is not). And as a reader may suggest, I volunteered to find out.

The plan is to centralize common code which is repeated over and over. This is done by using tty_port helpers. Next, we will move TTY I/O buffers from tty_struct to tty_port and revamp locking a bit. The move will also ensure that we will not need to care about tty_struct in a prevalent count of interrupt service routines, timers etc. They really need TTY buffers, not a structure which randomly comes and goes with every open and close the way tty_struct does. And since tty_port is in the memory intact as long as the device stays in the machine (and its interrupt service routine installed in the kernel), it is a perfect place to put the buffers in. And this is exactly what is happening here right now.

Stay tuned and report bugs!

Saturday, April 14, 2012

A Must-Have for Czech OpenStreetMappers

I collected the following URLs and find them useful when mapping: Besides these links, what is usually good to have is a GPS tracker. I use the one in my Nokia 5800 XM phone. Then It becomes handy if one has a bike to explore their hometown. And it really helps to have a (fast :)) motorbike to take a look at other cities.