xxyzz / ostep-hw

Operating Systems: Three Easy Pieces(OSTEP) homework and project solutions
GNU General Public License v3.0
763 stars 179 forks source link

Does chapter 8, question 5, have an incorrect answer? #5

Closed modulitos closed 3 years ago

modulitos commented 3 years ago

First, I just want to say thanks for sharing your solutions 🎉 This is a great resources as I'm working through these exercises.

On chapter 8, question 5, we have the following question:

Given a system with a quantum length of 10ms in its highest queue, how often would you have to boost jobs back to the highest priority level (with the -B flag) in order to guarantee that a single long-running (and potentially-starving) job gets at least 5% of the CPU?

And it looks like your answer is 50ms, but shouldn't it be 200ms? It seems like 10ms will have to be 5% of the boost period.

So given a boost period B, I thought the equation would look like this:

B * .05 = 10 ms

which makes B 200ms.

But maybe my answer is missing something? Perhaps there's an edge case where the 200ms boost period fails, but I can't think of one 🤔

xxyzz commented 3 years ago

You are right. I don't know what I was thinking back then. Thanks!

modulitos commented 3 years ago

Ah, good to know! Thanks for the quick response, and updating the repo 👍

I'll close this issue now, since it's resolved