[Libguestfs] [PATCH libguestfs 1/2] ocaml/implicit_close test: collect all currently unreachable blocks

Richard W.M. Jones rjones at redhat.com
Thu Jun 1 11:42:25 UTC 2023


On Thu, Jun 01, 2023 at 01:26:13PM +0200, Laszlo Ersek wrote:
> On 6/1/23 13:18, Richard W.M. Jones wrote:
> > [Sorry, not read the other replies yet, in meetings all day today]
> > 
> > On Wed, May 31, 2023 at 05:13:58PM +0100, Richard W.M. Jones wrote:
> >> To start with I have opened a discussion topic.  We can think about
> >> opening bugs later.
> >>
> >> https://discuss.ocaml.org/t/ocaml-heap-fsck-and-forcing-collection-of-unreachable-objects/12281
> > 
> > There were some replies to this thread.  One open merge request is
> > notable - it adds compaction back:
> > 
> >   https://github.com/ocaml/ocaml/pull/12193
> > 
> > although only for "small" blocks, less than 128 * 8-byte words, which
> > probably covers everything we do.
> 
> We likely don't have a structure type larger than 1KB :)
> 
> > It seems like full_major is the way to force freeing of unreachable
> > objects, in all versions of OCaml.
> 
> Ah, does that mean we don't need a version check here, after all? IIRC,
> you said that in OCaml 4, "compact" was a superset of "full_major". If
> "full_major" is sufficient for finalizing unreachable objects on OCaml 4
> too, then we can downgrade "compact" to "full_major" regardless of OCaml
> version.

Yes .. we use Gc.compact in at least two different ways.  Only where
we want the "free unreachable" meaning, replacing it with full_major
does seem sensible.  But we have to be careful not to replace the
other one ("do an fsck") at least until we understand the best way to
do that.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org


More information about the Libguestfs mailing list