I ran a couple of tests for pg_upgrade with 100k tables (created using the script here [0]) in order to demonstrate the potential benefits of this patch.
pg_upgrade --sync-method fsync real 5m50.072s user 0m10.606s sys 0m40.298s pg_upgrade --sync-method syncfs real 3m44.096s user 0m8.906s sys 0m26.398s pg_upgrade --no-sync real 3m27.697s user 0m9.056s sys 0m26.605s [0] https://postgr.es/m/3612876.1689443232%40sss.pgh.pa.us -- Nathan Bossart Amazon Web Services: https://aws.amazon.com