Git Product home page Git Product logo

io-page's Introduction

This library implements support for efficient handling of I/O memory pages on Unix and Xen.

IO pages are page-aligned, and wrapped in the Cstruct library to avoid copying the data contained within the page.

io-page's People

Contributors

avsm avatar chris00 avatar dinosaure avatar djs55 avatar hannesm avatar jonahbeckford avatar rgrinberg avatar samoht avatar sternenseemann avatar talex5 avatar thelortex avatar yallop avatar yomimono avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

io-page's Issues

deprecate the library

We should deprecate the library. There is no good reasons to expose io-pages to code which is not a device driver.

@djs55 do you think that's doable?

fails to compile on FreeBSD-CURRENT

due to stub_alloc_pages.c

#if !defined(__APPLE__)
#include <malloc.h>
#endif

where my c compiler complains (errors out!) that malloc.h has been replaced by stdlib.h.
A conjunct !defined(__FREEBSD__) should fix this issue.

caml_alloc_pages does not instruct the GC of how much memory could be free by a GC

For some reasons (I guess: because of the page alignment constraint) io-page uses its own allocator for bigarrays, which seems to replace OCaml caml_ba_alloc. But caml_ba_alloc was itself calling caml_alloc_custom, which would instruct the GC the amount of memory that could be reclaimed when finalizing that bloc. As imperfect as this is, it is still preferable than not letting the GC know that there are potentially a lot of memory to be reclaimed by GCing the bigarrays.

In my test program that does a lot of IO within 128MiB of RAM and dies from out-of-memoriness after a few minutes, this caml_alloc_pages holds around 20MiB alone, making it the second memory holder after caml_aligned_malloc (the mallocer for the heap) which holds 70MiB.

I think calling caml_alloc_custom or something to the same effect would improves the situation.
I'm not even sure those blocs are freed at all (and I'm setting up another experiment to check this).

cstruct.to_bigarray is not equal after going through io_page

I encounter to run in a failed assertion (line 20) in https://github.com/hannesm/test -- which reproduces the code ocaml-crunch contains for reading data from its key-value store.

a string is put into an io_page, and a cstruct of the given string length is exposed -- the cstruct is not equal (using to_bigarray) to a cstruct produced by of_string of the initial string...

this problem occurs here on FreeBSD (seems to work fine on linux) with io-page 1.4.0 and 1.2.0 at least...

Doesn't work from utop : function `mirage_alloc_pages' is not available

$ docker run --rm -it ocaml/opam:debian-9_ocaml-4.04.0
$ opam install utop io-page-unix
$ utop
utop # #require "io-page-unix";;
Error: The external function `mirage_alloc_pages' is not available
utop # #require "io-page";;
Error: The external function `mirage_alloc_pages' is not available      

Is this supposed to work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.