8000 Remove test_and_set operations by samoht · Pull Request #263 · mirage/ocaml-git · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove test_and_set operations #263

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 1 commit into from
Jan 10, 2018
Merged

Remove test_and_set operations #263

merged 1 commit into from
Jan 10, 2018

Conversation

samoht
Copy link
Member
@samoht samoht commented Jan 10, 2018

This is not possible to ensure it without locking everything which is
slow and uncessary. At an higher level, Irmin could do it by enforcing
a single-writer policy, so let Irmin handle this and simplify ocaml-git
instead.

This is not possible to ensure it without locking everything which is
slow and uncessary. At an higher level, Irmin could do it by enforcing
a single-writer policy, so let Irmin handle this and simplify ocaml-git
instead.
XXX(dinosaure): About the PACK file, we use directly mmap by the
[MAPPER] abstraction to compute efficiently all. I don't know if
it's reliable to keep this behaviour when we ensure than we use
[read] only for the loose object and mmap for the PACK file.
Copy link
Member Author

Choose a reason for hiding this comment

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

@dinosaure do you know if this comment is still up-to-date? What happen if one tries to open the same file a lot? Do we run out of inodes? Is seems that we don't have that weak cache of fd anymore. See #143 for the initial PR.

Copy link
Member

Choose a reason for hiding this comment

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

To the current implementation the PACK was handle in 2 two:

  1. when we meet a new PACK file (without the associated IDX file), we read entirely the PACK file (with read syscall) continuously to produce the IDX file and calculate some stuff.
  2. for all others, we use only the [MAPPER] abstraction (and, by this way, the mmap syscall) and keep file-descriptors of these PACK files along than the program run (so, one file-descriptor per PACK file - exactly one for the IDX file and one for the PACK file)

This is only about PACK file. And it's why, then, I explained it could be relevant to keep this for loose (big) object like blob. So we can delete the pool of open if you want when, only for PACK files, we use directly mmap - see Unpack.Decoder and specifically optimized_get.

Copy link
Member

Choose a reason for hiding this comment

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

So, I believed this comments stills up-to-date :) .

Copy link
Member Author

Choose a reason for hiding this comment

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

But that mmap_threashold variable is only used when doing a test-and-set, e.g. for modifying references. I don't understand how this is used for large blobs.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, yeah. You are true, so if you delete test_and_set, you should delete mmap_ threshold because ... And because the reference size should not upper than mmap_threshold, it's useless to keep it.

@samoht samoht merged commit df645e0 into mirage:master Jan 10, 2018
@samoht samoht deleted the test-and-set branch January 10, 2018 17:05
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.

2 participants
0