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

block allocator needs to try harder #15

Open
yomimono opened this issue Oct 4, 2022 · 0 comments
Open

block allocator needs to try harder #15

yomimono opened this issue Oct 4, 2022 · 0 comments

Comments

@yomimono
Copy link
Owner

yomimono commented Oct 4, 2022

With the following target:


(rule
  (alias big)
  (deps colossal)
  (locks colossal)
  (action (progn
            (run dd if=/dev/zero of=for_colossal.img bs=512 count=1000)
            (setenv OCAMLRUNPARAM b (run %{exe:chamelon.exe} format for_colossal.img 512))
            (setenv OCAMLRUNPARAM b (with-stdin-from colossal (run %{exe:chamelon.exe} write --verbosity=debug for_colossal.img 512 "colossal.bak" -)))
            (setenv OCAMLRUNPARAM b (with-stdin-from colossal (run %{exe:chamelon.exe} write --verbosity=debug for_colossal.img 512 "colossal.bak.bak" -)))

            (with-stdout-to colossal-ls.expected (run echo "colossal.bak : file"))
            (setenv OCAMLRUNPARAM b (with-stdout-to colossal-ls.output (run %{exe:chamelon.exe} ls for_colossal.img 512 "/")))
            (diff colossal-ls.expected colossal-ls.output)

            (setenv OCAMLRUNPARAM b (with-stdout-to colossal.bak (run %{exe:chamelon.exe} read for_colossal.img 512 "colossal.bak")))
            (run cmp colossal colossal.bak)
            (run %{exe:chamelon.exe} rm for_colossal.img 512 "/colossal.bak")

The write of colossal.bak.bak fails. colossal is the output of dd if=/dev/urandom of=colossal bs=128K count=1, so we would expect to be able to write this at least twice (2 * 128K = 256K) in our 512K filesystem, even with skip-list overhead. I suspect the allocator is finding an entire subsection full and then giving up.

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

No branches or pull requests

1 participant