If we consider an hierarchical single level write back cache with write allocate policy, then the formula for average access time during write operation is given by :-
Twrite = (H)(Tc) + (1-H)(Tc + Tm + (x*Tm)).
Where,
H= hit ratio of cache.
Tc=access time of cache.
Tm= access time of memory.
x= fraction of cache blocks which are dirty.
The above formula is given in this site https://gateoverflow.in/14480/formula-write-back-write-through-access-time-parallel-serial?show=14502#a14502
However, I think that formula is not entirely correct. According to me, during a write miss in case of write allocate,we first find a block to replace in the cache and if its dirty, we update the main memory. Now we bring the required cache block which contains the word into the cache and then update the cache. This is what I read in hamacher and patterson book.
So shouldn't the formula be
Twrite = (H)(Tc) + (1-H)(Tc + Tm + (x*Tm) + Tc). ?
Here I have added the extra Tc time at the end which is required to update the word in the cache once the block has been brought from main memory. First Tc is the time we add in case of miss because its hierarchical cache