Hi Remi, I thought about another possible way to handle minor collections in stm-c7. If we synchronize the threads to do minor collections, then we no longer need to force minor collections after each transaction. This is possible if we use a single coordinated nursery instead of one per thread. This is similar to Java GCs, which are multithreaded but still have only one nursery, out of which the threads allocate "blocks" at a time and then subdivide them in a thread-local way (here a "block" can be some small number of pages). After a transaction commits, the committed memory in the nursery can be seen by all threads, and we can unshare pages in order to modify objects. This is fine as long as we wait for all threads to reach a safe point when we do a minor collection --- which could then be done either using some general parallel GC technique, or something more subtle where each thread moves objects that are likely to be their own --- for example, objects that they allocated themselves. The main difference with Java GCs is what to do with pages that have been unshared. I think that reasoning about the total amount of syscalls needed, we can see that we may as well re-share the pages after a minor collection (because the alternative is to skip that page until the next major collection, but then it will have to be re-shared during the next major collection anyway). A bientôt, Armin.
participants (1)
-
Armin Rigo