bufmgr: Return early in ScheduleBufferTagForWriteback() if fsync=off

Andres Freund <andres@anarazel.de>

Commit: 488f826c729bd570c36df369fa8ac90c9a5a1b46
Author: Andres Freund <andres@anarazel.de>
Date: 2024-10-08T15:37:45Z
Releases: 18.0
bufmgr: Return early in ScheduleBufferTagForWriteback() if fsync=off

As pg_flush_data() doesn't do anything with fsync disabled, there's no point
in tracking the buffer for writeback. Arguably the better fix would be to
change pg_flush_data() to flush data even with fsync off, but that's a
behavioral change, whereas this is just a small optimization.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/1f6b50a7-38ef-4d87-8246-786d39f46ab9@iki.fi

Files

PathChange+/−
src/backend/storage/buffer/bufmgr.c modified +6 −1

Discussion

  • AIO v2.0 213 messages · 2024-09-01 → 2025-07-29