-
Notifications
You must be signed in to change notification settings - Fork 305
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
checkout/commit: Use glnx_regfile_copy_bytes() if possible #817
Conversation
Couldn't help writing this after I'd been spending some time staring at Before:
After:
|
bot, retest this please |
426ea19
to
aae7945
Compare
Rather than `g_output_stream_splice()`, where the input is a regular file. See GNOME/libglnx#44 for some more information. I didn't try to measure the performance difference, but seeing the read()/write() to/from userspace mixed in with the pointless `poll()` annoyed me when reading strace. As a bonus, we will again start using reflinks (if available) for `/etc`, which is a regression from the ostreedev#797 changes (which before used `glnx_file_copy_at()`). Also, for the first time we'll use reflinks when doing commits from file-backed content. This happens in `rpm-ostree compose tree` today for example. Update submodule: libglnx
Interesting; so the problem was that I think rhci was relying on github's auto-merge commit, rather than doing what homu would do via a rebase. A bit of a messy corner case; rhci would have to know that the repo was homu managed. But hopefully we can avoid that by relying on a FF-able PR, let's see. |
bot, retest this please |
if (g_output_stream_splice (output, input, 0, | ||
cancellable, error) < 0) | ||
return FALSE; | ||
if (G_IS_FILE_DESCRIPTOR_BASED (input)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this condition ever fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We expose as public API:
gboolean ostree_repo_write_content (OstreeRepo *self,
const char *expected_checksum,
GInputStream *object_input,
guint64 length,
guchar **out_csum,
GCancellable *cancellable,
GError **error);
So we have to support it. In practice using the command line tools, we will go through this code path when pulling from an archive
repo to a bare
one, since the content objects are zlib-compressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, that makes sense.
cancellable, error) < 0) | ||
return FALSE; | ||
if (fchmod (temp_fd, 0644) < 0) | ||
if (G_IS_FILE_DESCRIPTOR_BASED (input)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too. Seems like they're always fd-based, no? I'm not very familiar with GIO.
☀️ Test successful - status-atomicjenkins |
Rather than
g_output_stream_splice()
, where the input is a regularfile.
See GNOME/libglnx#44 for some more information.
I didn't try to measure the performance difference, but seeing the
read()/write() to/from userspace mixed in with the pointless
poll()
annoyed mewhen reading strace.
As a bonus, we will again start using reflinks (if available) for
/etc
,which is a regression from the #797
changes (which before used
glnx_file_copy_at()
).Also, for the first time we'll use reflinks when doing commits from file-backed
content. This happens in
rpm-ostree compose tree
today for example.