pull: use a single per-transaction syncfs instead of fsync
Do not write directly to objects/ but maintain pulled files under tmp/ with a "tmpobject-$CHECKSUM.$OBJTYPE" name until they are syncfs'ed to disk. Move them under objects/ at ostree_repo_commit_transaction cleanup time. Before (test done on a local network): $ LANG=C sudo time ./ostree --repo=repo pull origin master 0 metadata, 3 content objects fetched; 83820 KiB; 4 delta parts fetched, transferred in 417 seconds 16.42user 6.73system 6:57.19elapsed 5%CPU (0avgtext+0avgdata 248428maxresident)k 24inputs+794472outputs (0major+233968minor)pagefaults 0swaps After: $ LANG=C sudo time ./ostree --repo=repo pull origin master 0 metadata, 3 content objects fetched; 83820 KiB; 4 delta parts fetched, transferred in 9 seconds 14.70user 2.87system 0:09.99elapsed 175%CPU (0avgtext+0avgdata 256168maxresident)k 0inputs+794472outputs (0major+164333minor)pagefaults 0swaps https://bugzilla.gnome.org/show_bug.cgi?id=728065 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
1 parent
10642cd732
commit
27a45e2edb
3 files changed
+197
-40
No files matched your search
@@ -34,6 +34,8 @@ G_BEGIN_DECLS
|
||||
struct OstreeRepo {
|
||||
GObject parent;
|
||||
|
||||
char *boot_id;
|
||||
|
||||
GFile *repodir;
|
||||
GFile *tmp_dir;
|
||||
int tmp_dir_fd;
|
||||
@@ -82,6 +84,11 @@ _ostree_repo_ensure_loose_objdir_at (int dfd,
|
||||
const char *loose_path,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
void
|
||||
_ostree_repo_get_tmpobject_path (OstreeRepo *repo,
|
||||
char *output,
|
||||
const char *checksum,
|
||||
OstreeObjectType objtype);
|
||||
|
||||
gboolean
|
||||
_ostree_repo_find_object (OstreeRepo *self,
|
||||
@@ -101,6 +108,7 @@ _ostree_repo_has_loose_object (OstreeRepo *self,
|
||||
OstreeObjectType objtype,
|
||||
gboolean *out_is_stored,
|
||||
char *loose_path_buf,
|
||||
GFile **out_stored_path,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
||||
Reference in new issue
Block a user