Energy/lifetime cooptimization by cache partitioning with graceful performance degradation