Add some features

Support threshold feature, idle interval feature, on demand write back
feature.