Drivers travelling along part of the A40 in Gloucestershire can expect nine months of disruption.