Hi,
Le 2025-01-01 16:15, Nikolaus Rath a écrit :
That is not my understanding of the issue. The proposal was to disable
fsync after individual files have been unpacked, i.e. multiple times
per
package. Not about one final fsync just before dpkg exits.
The way fsync works, that would still be multiple times per package
anyway, as fsync has to be called for every file to be written. The way
dpkg works, there is no such thing as "one final fsync before exit":
dpkg processes packages sequentially and commits the writes after
processing each package [1]. There are however already some existing
optimizations that have been reported in this thread [2], notably this
one:
* Then we reworked the code to defer and batch all the fsync()s for
a specific package after all the file writes, and before the
renames,
which was a bit better but not great.
The code in question is there [3] btw, if anyone wants to take a look.
After reading that and current ext4 features and default mount options
it seems now likely to me that not much (if any) performance
improvements or write amplification reductions are to be expected from
--force-unsafe-io alone. I'm now waiting for our very welcome volunteer
to come back with numbers that will hopefully end that cliffhanger.
Cheers,
[1] and there is potential for optimizations there, but getting them 1.
to just work and then 2. to be at least as safe as the current code is
not exactly going to be trivial.
[2]: https://lists.debian.org/debian-devel/2024/12/msg00597.html
[3]:
https://sources.debian.org/src/dpkg/1.22.11/src/main/archives.c/#L1159
--
Julien Plissonneau Duquène