Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hardlink: logging and performance improvements #3549

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

Merged
merged 3 commits into from
May 5, 2025

Conversation

karelzak
Copy link
Collaborator

The second patch should also be backported into stable/v2.41 and stable/v2.42.

Now that jlog() is a function, all gettext() arguments are evaluated
in all cases, including when output is unnecessary due to --quiet or
low verbose mode.

Fixes: util-linux#3548
Signed-off-by: Karel Zak <[email protected]>
During work on better verbose output, I found a regression between
v2.40 and v2.41 (and v2.42). In the new version, hardlink is 3-4 times
slower.

The problem is in the function where we verify signals. It calls the
function signal() even though no signal is delivered. It's called in
code loops where hardlink scans files, making it a performance-sensitive
area.

Another significant performance improvement is using an inline function
for handle_interrupt().

This simple patch improves hardlink performance by 10 times.

Fixes: http://github.com/util-linux/util-linux/commit/1453200e22dd4ec858be027653c167225f2fb358
Signed-off-by: Karel Zak <[email protected]>
The functions are called many times.

Signed-off-by: Karel Zak <[email protected]>
@karelzak karelzak force-pushed the PR/hardlink-logging branch from d5b661e to 5ef57d5 Compare April 29, 2025 10:54
@karelzak karelzak merged commit 48cf648 into util-linux:master May 5, 2025
33 checks passed
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

Successfully merging this pull request may close these issues.

1 participant