ferrous26 / cs452-flaming-meme

CS452 Real Time Programming
MIT License
2 stars 1 forks source link

Restructure kernel data structures #112

Closed ferrous26 closed 10 years ago

ferrous26 commented 10 years ago

So that we can lock only half the descriptor related things into the cache.

We will need to separate things into kernel sections:

big kernel for the descriptor table

small kernel for the active task pointer and interrupt handling pointers, and also the lookup table

We might want to take this opportunity to replace the free list with a bit mask that works like the priority lookup table. Our descriptor use will be less spread out (which might hurt debugging), but it will be more likely to reuse descriptors (and stack) that is already in the cache.

ferrous26 commented 10 years ago

Half done.

ferrous26 commented 10 years ago

So, realized that a bit mask is actually a terrible idea for the task descriptor free list. Why? Because it is not constant time.

What we have now is constant time, but it eats up lots of memory (relatively).

So, I asked myself, how do we keep a list of tasks in a memory efficient way? Like the way we do for scheduling and receive queues?

Well, we're not using the next pointer in a task when the task is dead...so, we could just use it again for the free list. It would be super space efficient, we'd only need the overhead of a head and tail pointer.

This also means we could extend the size of our task descriptor table arbitrarily. Want to go to 512? 1024? No problem.

Unverified commented 10 years ago

The problem is we also use the next pointer to signify that the task is dead so we would need to do something else we can use as a dead check. Right now I do t want to change shit until trains can do trains things

ferrous26 commented 10 years ago

We use the stack pointer to signify that a task is dead. The next pointer is free. I put the comment here so I will remember to do this later.

ferrous26 commented 10 years ago

I lied. It is done now.