The military had over 400,000 M1911A1 pistols in inventory when the M9 was selected. Most of them were "unserviceable". If they really were, or were declared such to get the M9 rolling is open for debate. In 1984 I was isuued an M1911A1 made by Remington during WWII that worked fine.
IIRC, over 450,000 M9s have been bought so far. Original 5 year contract for 350,000 pistols called for first year pistols to be made/assembled in Italy, second year made there/assembled here, third through fifth year made/assembled here. Since you-know-what, the Reserves and Navy have both bought more M9s. Go figure.
Replacing all of them would probably cost over $50 million. A lot of money, but less than the cost of one fighter aircraft.
During development of the P-series, Ruger was advised by someone very familiar with the JSSAP (Joint Services Small Arms Project) requirements. The Ruger still failed the M10 trials, they did know why, and they did not contest. BTW, S&W failed the test for firing pin energy (calculations were wrong; they really passed) and the 5000 round durability test. Gun frames cracked under 5000 rounds. S&W argued the guns completed the 5000 round test within the relaiblity standard anyway, so the cracked frames shouldn't have disqualified them; the govt disagreed. Spin that any way ya want. The Ruger was at the bottom of the FBI pistol evaluations in the late 80s (then again, so was the Glock). Ruger, Glock, and S&W were all passed over by the INS/Border Patrol for the Beretta after their pistol T&E. I heard Ruger offered the Southport CT/Prescott AZ PD free Rugers but they decided to buy Glocks. Don't know if it's true, but it's a great story.
The revolvers semed to be gaining ground on the S&Ws in federal service when the big switch to autos hit (Marshals, INS/BP).
Rugers are good guns and they sell great on the civilian market; don't seem to do as well in the mil/pol market here or abroad (I have seen some Ruger autos in Israel and Turkey, and I think the Brits and French bought some revolvers).
I was going somewhere with all this, but I got lost...