bv_cache update, fixed a potential racing problem and added immediate...
There are two parts of changes. The first part of the change is to provide the funtionality that a cache page is actively written back to FS when a certain number of bytes has been written into the page. This can avoid having a lot of page write back in the end.
The second part of the change is to fix a potential problem that can occur when we use a corner parameter settings for cache pages. I observed a problem for program crash due to cache_free for certain settings. This has been fixed by using a lock protection. The performance problem is not big, because these memory operations are rare.
I have tested this branch on Summit with coll_test and the largest E3SM-IO F case. The results are correct. I have also tested many different parameter settings on my local environment. The results are correct.