This phase I trial is studying the side effects and best dose of flavopiridol when given together with vorinostat in treating patients with relapsed or refractory acute leukemia or chronic myelogenous leukemia or refractory anemia. Flavopiridol and vorinostat may cause leukemia cells to look more like normal cells, and to grow and spread more slowly. Vorinostat may also stop the growth of cancer cells by blocking some of the enzymes needed for cell growth. Giving flavopiridol together with vorinostat may be an effective treatment for leukemia or refractory anemia.