Immix on GHC Summer of Code weekly report #8

My project.

This post assumes that the reader has read my last post.

This week I could get my focus on the project again, since most of my classes are already over. I’ve investigated the segfault that was happening in GHC with +RTS -w -DS, and I noticed that the code in rts/sm/Sanity.c assumed that all objects in the allocated area of the block are being used.

    for (; bd != NULL; bd = bd->link) {
	p = bd->start;
	while (p < bd->free) {
	    nat size = checkClosure((StgClosure *)p);
	    /* This is the smallest size of closure that can live in the heap */
	    ASSERT( size >= MIN_PAYLOAD_SIZE + sizeofW(StgHeader) );
	    p += size;
	    
	    /* skip over slop */
	    while (p < bd->free &&
		   (*p < 0x1000 || !LOOKS_LIKE_INFO_PTR(*p))) { p++; } 
	}
    }

Since this is true for copy collection and mark compact, it was only with mark sweep that the error happened. The only way I could manage to make the segfault disappear by now was marking the swept blocks with a new flag, and avoid running this code in them.

So I went back to my old problem with the allocation of memory in lines. I noticed that (one of) the problem(s) may be that the object that is allocated in the free line is not scavenged after the evacuation. When the object is allocated in a block, using the current allocation method, it will eventually be scavenged, because all blocks that were being used to allocation are scavenged. I’m planning to implement a list of lines that need to be scavenged and code to scavenge the lines in this list, and the current line. It’ll be very similar to the code that does this with blocks.

About these ads

2 Respostas to “Immix on GHC Summer of Code weekly report #8”

  1. Immix on GHC Summer of Code weekly report #9 « Blog do Marcot Says:

    [...] Blog do Marcot « Immix on GHC Summer of Code weekly report #8 [...]

  2. Immix on GHC Summer of Code report #11 « Blog do Marcot Says:

    [...] patch is only needed to make it possible to run the binary with the parameters +RTS -w -DS -RTS. I’ve already explained this patch. I didn’t measure the difference in performance before this patch, since it only changes code [...]

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s


Seguir

Obtenha todo post novo entregue na sua caixa de entrada.

%d blogueiros gostam disto: