help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Read-only oldspace


From: Gwenael Casaccio
Subject: [Help-smalltalk] Read-only oldspace
Date: Thu, 12 May 2011 17:16:56 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10

Hi,

If you read the squeak vm mailing they talk about read only objects.
But wait, we've read only why should we change it?? In GST it's done by testing at "each" access if the object is RO or not. But we can do it lazily by using the hardware and operating system. Objects can be putted in a separate space with read-only access, thus we get a page fault when you try to change an object.

I've implemented the first step a separate space for the *old* read-only
objects. I've first fixed a bug with the oldspace_nomemory each space
should have its own function. Thus there are for each space a *space_nomemory, gst_init_mem_default initialize the new ro_oldspace.
The macro MAKE_OOP_READONLY calls the _gst_make_oop_readonly function:

* first I check if the oop ro state is the same as the new state; if
yes I leave.

* If the object is fixed or young I only change the state BUT if the object is old it is moved inside a ro_oldspace if it becomes RO or it's moved from the ro_oldspace to the oldspace it is writeable

* gst_make_oop_fixed check if is old and remove the object from the right space (oldspace or ro_old_space)

* the oldspace_nomemory, fixedspace_nomemory, ro_oldspace_nomemory returns
the correct heap ;-)

* _gst_compact: i'll compact the memory of both oldspace and ro_oldspace, I don't use the new heap size to grow the ro_oldspace heap size.
* _gst_sweep_oop is changed to free the memory from the right space ;-)
* the image loading is updated to take care of the ro_oldspace

I think it's all ;-)

Right now the ro mapping is not done but as Paolo said on IRC the patch will give less false positive on grey page scanning.

Cheers,
Gwen

Attachment: ro-space.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]