Dialysis is where a machine is used to replace a kidney after kidney failure . Dialysis may be used for those with an acute disturbance in kidney function ( acute kidney injury , previously acute renal failure ) or for those with progressive but chronically worsening kidney functionâ `` a state known as chronic kidney disease stage 5 ( previously chronic renal failure or end-stage kidney disease ) .