Controllable non-Markovianity in phase relaxation