Author: Remi Meier <[email protected]>
Branch: c8-overflow-objs
Changeset: r1675:c41ca067e953
Date: 2015-02-27 11:35 +0100
http://bitbucket.org/pypy/stmgc/changeset/c41ca067e953/
Log: rename new_objects to overflow objs
diff --git a/c8/stm/core.c b/c8/stm/core.c
--- a/c8/stm/core.c
+++ b/c8/stm/core.c
@@ -766,7 +766,7 @@
}
assert(list_is_empty(STM_PSEGMENT->modified_old_objects));
- assert(list_is_empty(STM_PSEGMENT->new_objects));
+ assert(list_is_empty(STM_PSEGMENT->large_overflow_objects));
assert(list_is_empty(STM_PSEGMENT->objects_pointing_to_nursery));
assert(list_is_empty(STM_PSEGMENT->young_weakrefs));
assert(tree_is_cleared(STM_PSEGMENT->young_outside_nursery));
@@ -827,7 +827,7 @@
STM_PSEGMENT->safe_point = SP_NO_TRANSACTION;
STM_PSEGMENT->transaction_state = TS_NONE;
list_clear(STM_PSEGMENT->objects_pointing_to_nursery);
- list_clear(STM_PSEGMENT->new_objects);
+ list_clear(STM_PSEGMENT->large_overflow_objects);
release_thread_segment(tl);
/* cannot access STM_SEGMENT or STM_PSEGMENT from here ! */
@@ -847,10 +847,11 @@
#endif
}
-static void push_new_objects_to_other_segments(void)
+static void push_large_overflow_objects_to_other_segments(void)
{
+ /* XXX: also pushes small ones right now */
acquire_privatization_lock(STM_SEGMENT->segment_num);
- LIST_FOREACH_R(STM_PSEGMENT->new_objects, object_t *,
+ LIST_FOREACH_R(STM_PSEGMENT->large_overflow_objects, object_t *,
({
assert(item->stm_flags & GCFLAG_WB_EXECUTED);
item->stm_flags &= ~GCFLAG_WB_EXECUTED;
@@ -867,7 +868,7 @@
in handle_segfault_in_page() that also copies
unknown-to-the-segment/uncommitted things.
*/
- list_clear(STM_PSEGMENT->new_objects);
+ list_clear(STM_PSEGMENT->large_overflow_objects);
}
@@ -882,7 +883,7 @@
dprintf(("> stm_commit_transaction()\n"));
minor_collection(1);
- push_new_objects_to_other_segments();
+ push_large_overflow_objects_to_other_segments();
/* push before validate. otherwise they are reachable too early */
bool was_inev = STM_PSEGMENT->transaction_state == TS_INEVITABLE;
_validate_and_add_to_commit_log();
@@ -1008,7 +1009,7 @@
tl->last_abort__bytes_in_nursery = bytes_in_nursery;
list_clear(pseg->objects_pointing_to_nursery);
- list_clear(pseg->new_objects);
+ list_clear(pseg->large_overflow_objects);
list_clear(pseg->young_weakrefs);
#pragma pop_macro("STM_SEGMENT")
#pragma pop_macro("STM_PSEGMENT")
diff --git a/c8/stm/core.h b/c8/stm/core.h
--- a/c8/stm/core.h
+++ b/c8/stm/core.h
@@ -88,8 +88,9 @@
/* list of objects created in the current transaction and
that survived at least one minor collection. They need
to be synchronized to other segments on commit, but they
- do not need to be in the commit log entry. */
- struct list_s *new_objects;
+ do not need to be in the commit log entry.
+ XXX: for now it also contains small overflow objs */
+ struct list_s *large_overflow_objects;
uint8_t privatization_lock; // XXX KILL
diff --git a/c8/stm/gcpage.c b/c8/stm/gcpage.c
--- a/c8/stm/gcpage.c
+++ b/c8/stm/gcpage.c
@@ -242,7 +242,7 @@
stmcb_trace(realobj, &mark_record_trace);
/* trace all references found in sharing seg0 (should always be
- up-to-date and not cause segfaults, except for new objs) */
+ up-to-date and not cause segfaults, except for overflow objs) */
while (!list_is_empty(marked_objects_to_trace)) {
obj = (object_t *)list_pop_item(marked_objects_to_trace);
@@ -380,7 +380,7 @@
/* look at all objs on the shadow stack (they are old but may
be uncommitted so far, so only exist in the associated_segment_num).
- IF they are uncommitted new objs, trace in the actual segment,
+ IF they are uncommitted overflow objs, trace in the actual segment,
otherwise, since we just executed a minor collection, they were
all synced to the sharing seg0. Thus we can trace them there.
@@ -423,13 +423,13 @@
}
}
-static void ready_new_objects(void)
+static void ready_large_overflow_objects(void)
{
#pragma push_macro("STM_PSEGMENT")
#pragma push_macro("STM_SEGMENT")
#undef STM_PSEGMENT
#undef STM_SEGMENT
- /* objs in new_objects only have garbage in the sharing seg0,
+ /* objs in large_overflow only have garbage in the sharing seg0,
since it is used to mark objs as visited, we must make
sure the flag is cleared at the start of a major collection.
(XXX: ^^^ may be optional if we have the part below)
@@ -437,14 +437,14 @@
Also, we need to be able to recognize these objects in order
to only trace them in the segment they are valid in. So we
also make sure to set WB_EXECUTED in the sharing seg0. No
- other objs than new_objects have WB_EXECUTED in seg0 (since
+ other objs than large_overflow_objects have WB_EXECUTED in seg0 (since
there can only be committed versions there).
*/
long i;
for (i = 1; i < NB_SEGMENTS; i++) {
struct stm_priv_segment_info_s *pseg = get_priv_segment(i);
- struct list_s *lst = pseg->new_objects;
+ struct list_s *lst = pseg->large_overflow_objects;
LIST_FOREACH_R(lst, object_t* /*item*/,
({
@@ -507,8 +507,8 @@
modified_old_objs. */
}
- /* remove from new_objects all objects that die */
- lst = pseg->new_objects;
+ /* remove from large_overflow_objects all objects that die */
+ lst = pseg->large_overflow_objects;
uintptr_t n = list_count(lst);
while (n-- > 0) {
object_t *obj = (object_t *)list_item(lst, n);
@@ -683,7 +683,7 @@
DEBUG_EXPECT_SEGFAULT(false);
- ready_new_objects();
+ ready_large_overflow_objects();
/* marking */
LIST_CREATE(marked_objects_to_trace);
diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c
--- a/c8/stm/nursery.c
+++ b/c8/stm/nursery.c
@@ -132,9 +132,8 @@
nobj_sync_now = ((uintptr_t)nobj) | FLAG_SYNC_LARGE;
}
- /* if this is not during commit, we will add them to the new_objects
- list and push them to other segments on commit. Thus we can add
- the WB_EXECUTED flag so that they don't end up in modified_old_objects
*/
+ /* if this is not during commit, we make them overflow objects
+ and push them to other segments on commit. */
assert(!(nobj->stm_flags & GCFLAG_WB_EXECUTED));
if (!STM_PSEGMENT->minor_collect_will_commit_now) {
nobj->stm_flags |= GCFLAG_WB_EXECUTED;
@@ -203,15 +202,16 @@
_collect_now(obj);
if (obj_sync_now & FLAG_SYNC_LARGE) {
+ /* XXX: SYNC_LARGE even set for small objs right now */
/* this is a newly allocated obj in this transaction. We must
either synchronize the object to other segments now, or
- add the object to new_objects list */
+ add the object to large_overflow_objects list */
if (STM_PSEGMENT->minor_collect_will_commit_now) {
acquire_privatization_lock(STM_SEGMENT->segment_num);
synchronize_object_enqueue(obj);
release_privatization_lock(STM_SEGMENT->segment_num);
} else {
- LIST_APPEND(STM_PSEGMENT->new_objects, obj);
+ LIST_APPEND(STM_PSEGMENT->large_overflow_objects, obj);
}
}
@@ -219,7 +219,7 @@
lst = STM_PSEGMENT->objects_pointing_to_nursery;
}
- /* flush all new objects to other segments now */
+ /* flush all overflow objects to other segments now */
if (STM_PSEGMENT->minor_collect_will_commit_now) {
acquire_privatization_lock(STM_SEGMENT->segment_num);
synchronize_objects_flush();
diff --git a/c8/stm/setup.c b/c8/stm/setup.c
--- a/c8/stm/setup.c
+++ b/c8/stm/setup.c
@@ -100,7 +100,7 @@
pr->pub.segment_num = i;
pr->pub.segment_base = segment_base;
pr->modified_old_objects = list_create();
- pr->new_objects = list_create();
+ pr->large_overflow_objects = list_create();
pr->young_weakrefs = list_create();
pr->old_weakrefs = list_create();
pr->objects_pointing_to_nursery = list_create();
@@ -148,8 +148,8 @@
assert(list_is_empty(pr->objects_pointing_to_nursery));
list_free(pr->objects_pointing_to_nursery);
list_free(pr->modified_old_objects);
- assert(list_is_empty(pr->new_objects));
- list_free(pr->new_objects);
+ assert(list_is_empty(pr->large_overflow_objects));
+ list_free(pr->large_overflow_objects);
list_free(pr->young_weakrefs);
list_free(pr->old_weakrefs);
tree_free(pr->young_outside_nursery);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit