The effect of carbon and oxygen impurity atoms on the migration rate of tilt boundaries with the <100> and <111> misorientation axes in fcc metals Ni, Ag, Al was studied by means of the molecular dynamics method. It is shown that the introduction of impurity atoms of light elements led to a significant inhibition of the migration of grain boundaries: with the introduction of 5 % by almost an order of magnitude, 10 % -by two orders of magnitude. Carbon atoms tend to form aggregates, which, being fixed on the grain boundary, become effective stoppers that prevent the boundary moving. Oxygen atoms did not form aggregates, but because of the high values of the binding energy with the boundaries, they also effectively hampered their migration. In contrast to the formation of aggregates by carbon atoms, in the case of oxygen impurity, another effect takes place -"loosening" and an increase in the width of the boundary. For impurity atoms of carbon and oxygen, the binding energies with grain-boundary edge dislocations in the metals under consideration were calculated. The obtained values correlate well with the dependences of the grain boundary migration rate on the impurity concentration: the greatest effect of impurities on the boundary migration rate and the value of the binding energy were obtained for the Al-C system, the smallest -for Ag-O.