For math and computer science, a good rule of thumb is to treat the exercises as the primary way to learn, and to refer to the rest of the text as support to help you with the exercises.
That extends to reading academic papers; but there you have to come up with your own exercises.
(I say rule-of-thumb, because it's a good approach, but please don't take it as gospel.)
You don't need to do 100% of the exercises. A random selection is usually sufficient: the goal is to get good enough that you _could_ do any of the exercises.