Irritating the Kernel

The kernel has many cache like functions. X is computed from Y and Z and kept to speed subsequent cases. Logic always exists to note when Y or Z changes so as to nullify the cached value for X. These caching relationships may be several deep. The kernel routine “check” runs at strategic times verifying that such cached value of X indeed corresponds to current values of Y and Z.

Here I record some ideas for a closely held key that can cause the kernel to uncache values and similar kernel actions solely for the purpose of catching the kernel off base and quickly driving the kernel thru its corner cases.

The key should be able to cause the kernel's check routine to run. That routine has many independent parts and it might be strategic to invoke them separately, especially if the extra kernel code to do so is small. I think it is.

It should be possible to unprepare a key and to unprepare a node. It should be possible to clean a page or node and to free the frame of a clean page or node.

There are a number of fixed size tables in the kernel. In such tables an entry is almost always immediately reclaimable. There the irritation key should be able to free particular entries in particular tables.

In each of the above cases the key merely invokes extant kernel routines. I suspect that the key should always “do it the slow way’ thus reducing the situations where the table is explicitly or implicitly locked. Consider the case of a domain wielding the irritation key to unprepare its own domain root.

The key should probably always return the same value. The regression test is whether the kernel crashes, perhaps thru check finding an error.

A really bizarre proposal is to have meta page keys and meta node keys, new kernel key types. They would designate pages and nodes. They would always return kt+1 and perhaps other meta keys. If mn is a meta key to node n then order 3 on mn returns the meta key to the page or node designated by the key in slot 3 of node n. The meta keys could be used to irritate the kernel regarding the page or node that they designate. Holding a meta key to a domain root allows one to poke at the component parts of a node yet without revealing to the poker any details of the domain; dead reckoning.

The holder of a meta key cannot be sure that it is not DK(0), except by noting that it caused a crash.


One point not bearing on the irritation key, but bearing on kernel regression tests, is that some test should store into a slot of a segment node the immediately access memory defined by that slot to see if the effect is immediate. Such tests invoke much kernel code. Note that for each virtual address there are likely to be several slots that collectively define the meaning of that address.