Skip to content

Commit

Permalink
Remove gc_lh_block_event (dotnet#2059)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored and MichalStrehovsky committed Mar 31, 2020
1 parent 1e20749 commit 1c7c5ab
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
36 changes: 2 additions & 34 deletions src/Native/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2823,8 +2823,6 @@ BOOL gc_heap::bgc_thread_running;

CLRCriticalSection gc_heap::bgc_threads_timeout_cs;

GCEvent gc_heap::gc_lh_block_event;

#endif //BACKGROUND_GC

#ifdef MARK_LIST
Expand Down Expand Up @@ -16516,8 +16514,6 @@ void gc_heap::init_background_gc ()
background_saved_lowest_address,
background_saved_highest_address));
}

gc_lh_block_event.Reset();
}

#endif //BACKGROUND_GC
Expand Down Expand Up @@ -28323,36 +28319,18 @@ BOOL gc_heap::create_bgc_threads_support (int number_of_heaps)

BOOL gc_heap::create_bgc_thread_support()
{
BOOL ret = FALSE;
uint8_t** parr;

if (!gc_lh_block_event.CreateManualEventNoThrow(FALSE))
{
goto cleanup;
}

//needs to have room for enough smallest objects fitting on a page
parr = new (nothrow) uint8_t*[1 + OS_PAGE_SIZE / MIN_OBJECT_SIZE];
if (!parr)
{
goto cleanup;
return FALSE;
}

make_c_mark_list (parr);

ret = TRUE;

cleanup:

if (!ret)
{
if (gc_lh_block_event.IsValid())
{
gc_lh_block_event.CloseEvent();
}
}

return ret;
return TRUE;
}

int gc_heap::check_for_ephemeral_alloc()
Expand Down Expand Up @@ -28437,7 +28415,6 @@ void gc_heap::kill_gc_thread()
// In the secodn stage, we have the Loader lock and only one thread is
// alive. Hence we do not need to kill gc thread.
background_gc_done_event.CloseEvent();
gc_lh_block_event.CloseEvent();
bgc_start_event.CloseEvent();
bgc_threads_timeout_cs.Destroy();
bgc_thread = 0;
Expand Down Expand Up @@ -34113,10 +34090,6 @@ void gc_heap::background_sweep()

//block concurrent allocation for large objects
dprintf (3, ("lh state: planning"));
if (gc_lh_block_event.IsValid())
{
gc_lh_block_event.Reset();
}

for (int i = 0; i <= (max_generation + 1); i++)
{
Expand Down Expand Up @@ -34480,11 +34453,6 @@ void gc_heap::background_sweep()

disable_preemptive (true);

if (gc_lh_block_event.IsValid())
{
gc_lh_block_event.Set();
}

add_saved_spinlock_info (true, me_release, mt_bgc_loh_sweep);
leave_spin_lock (&more_space_lock_loh);

Expand Down
11 changes: 0 additions & 11 deletions src/Native/gc/gcee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,6 @@ uint32_t gc_heap::background_gc_wait (alloc_wait_reason awr, int time_out_ms)
return dwRet;
}

// Wait for background gc to finish sweeping large objects
void gc_heap::background_gc_wait_lh (alloc_wait_reason awr)
{
dprintf(2, ("Waiting end of background large sweep"));
assert (gc_lh_block_event.IsValid());
fire_alloc_wait_event_begin (awr);
user_thread_wait (&gc_lh_block_event, FALSE);
fire_alloc_wait_event_end (awr);
dprintf(2, ("Waiting end of background large sweep is done"));
}

#endif //BACKGROUND_GC


Expand Down
5 changes: 0 additions & 5 deletions src/Native/gc/gcpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3114,8 +3114,6 @@ class gc_heap
PER_HEAP_ISOLATED
void fire_alloc_wait_event_end (alloc_wait_reason awr);
PER_HEAP
void background_gc_wait_lh (alloc_wait_reason awr = awr_ignored);
PER_HEAP
uint32_t background_gc_wait (alloc_wait_reason awr = awr_ignored, int time_out_ms = INFINITE);
PER_HEAP_ISOLATED
void start_c_gc();
Expand Down Expand Up @@ -3663,9 +3661,6 @@ class gc_heap
PER_HEAP_ISOLATED
GCEvent ee_proceed_event;

PER_HEAP
GCEvent gc_lh_block_event;

PER_HEAP_ISOLATED
bool gc_can_use_concurrent;

Expand Down

0 comments on commit 1c7c5ab

Please sign in to comment.