Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the "minimize writes" feature #1080

Closed
dmach opened this issue Feb 19, 2020 · 3 comments
Closed

Improve the "minimize writes" feature #1080

dmach opened this issue Feb 19, 2020 · 3 comments

Comments

@dmach
Copy link

dmach commented Feb 19, 2020

There's a currently inactive feature[1] to minimize writes on SSDs.
I recently realized that it could be extended to even skip computing the checksums.
That would improve speed not only on SSDs, but also rotating SMR[2] drives where the performance temporarily degrades with random writes.

What the change would be all about:

_minimize_writes 0

  • standard behavior

_minimize_writes 1

  • the already implemented behavior when a new file is written only if the checksum differs

_minimize_writes 2

  • if the file checksums in the new and old rpm headers matches and mtime+size matches, don't update the file on disk; == skip computing the checksum, rely on header content
  • this should be used only if users know what they're doing because rpm wouldn't have to restore all files a user manually changed on disk
  • but still, various build tools and anything that runs in an isolated environment could use that and benefit from lower IO load

[1] Commit: 29c48e1
[2] https://en.wikipedia.org/wiki/Shingled_magnetic_recording

@pmatilai
Copy link
Member

  1. would break just about every promise that rpm ever made about file integrity, I don't really see this as a supportable option. At any rate such a thing could not be an innocent looking second level of minimize_writes, it'd need some long and very scary option name.

@ffesti
Copy link
Contributor

ffesti commented Feb 19, 2020

Implementation otoh should be pretty straight forward. A simple if at https://github.com/rpm-software-management/rpm/blob/master/lib/rpmfi.c#L995 that does equal = 1; goto exit; should do the trick. Passing in the option without expanding the macro for every file may be a bit more complicated but not a roadblock.

@ffesti ffesti added this to Needs triage in Ticket Review (Outdated) Mar 3, 2020
@ffesti
Copy link
Contributor

ffesti commented Feb 12, 2021

While this is easy to implement this is probably not the right trade off. The regular minimize writes feature already saves a lot. We'd rather not allow rpm to take chances when it comes to correctness of the operation for a relatively little speed up.

@ffesti ffesti closed this as completed Feb 12, 2021
Ticket Review (Outdated) automation moved this from Needs triage to Closed Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants