$h_1→L1$ hit ratio
$h_2→L2$ hit ratio
$C_1→ L1$ access time
$C_2→ $Miss penalty to transfer information from L2 to L1
$M→$ Miss penalty to transfer information from main memory to L2
Average access time given in Carl Hamacher's book is
Shouldn’t it be
where $C_2’\rightarrow$ L2 access time (note that this is different from $C_2$)
When L2 miss occurs, book formula considers only $M$, that is moving data from memory to L2. Isnt this data also moved from L2 to L1 making us add $C_2$? Also $C_2$ and $M$ are duration for moving data from L2 to L1 and memmory to L2 respectively. These are penalties. But before penalties, a miss occurs which requires $C_1$ time for L1 miss and $C_2’$ time for L2 miss. But these does not seem to have added in the book formula. I have added them as highlighted in red.
Is my equation correct or book’s equation. Or something more is going on here, which I am unaware of?