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

lockfile: merge Seek+Read/Write into Pread/Pwrite #938

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

giuseppe
Copy link
Member

@giuseppe giuseppe commented Jun 9, 2021

drop a call to Seek and use the Pread and Pwrite syscalls instead that
already accept an offset.

Signed-off-by: Giuseppe Scrivano [email protected]

drop a call to Seek and use the Pread and Pwrite syscalls instead that
already accept an offset.

Signed-off-by: Giuseppe Scrivano <[email protected]>
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2021

Nice
LGTM

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2021

@giuseppe How did you find this?

@giuseppe
Copy link
Member Author

giuseppe commented Jun 9, 2021

@giuseppe How did you find this?

I was looking at strace and noticed way too many lseek calls:

# strace -q -f -c -e lseek podman run --rm fedora true
[pid 2842325] ????( <detached ...>
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000471           3       120           lseek
------ ----------- ----------- --------- --------- ----------------
100.00    0.000471           3       120           total

with the fix:

# strace -q -f -c -e lseek bin/podman run --rm fedora true
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000073           2        28           lseek
------ ----------- ----------- --------- --------- ----------------
100.00    0.000073           2        28           total

@rhatdan rhatdan merged commit 23c70d0 into containers:master Jun 9, 2021
@vrothberg
Copy link
Member

I adore such improvements. Great catch!

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.

4 participants