I forgot to mention one important detail. The "head" index will stay
on the page frame. That way we do not need to figure out which
head_page we are on. We grab the head_page, we atomically
(local_inc_return) the head pointer on that page. If the return value is
still on the page, we succeeded. We can also increment a value on this
page frame that will prevent recording if we somehow overflowed the buffer
before relinquishing the stack.
That is
reserve_event()
IRQ->
reserve_event();
[...]
IRQ->reserve_event() came back to original head!
Here we do not have a big enough buffer, and this is just stupid ;-)
We would drop packets in this case, and should drop the guy on his
head who came up with the too small buffer.
-- Steve
--