Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.2 multicore markdelay #3029

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions ocaml/otherlibs/str/str.ml
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,6 @@ external re_search_forward: regexp -> string -> int -> int array
external re_search_backward: regexp -> string -> int -> int array
= "re_search_backward"

module Domain = struct
module DLS = struct

(* CR ocaml 5 domains: Remove this proxy and use the real Domain.DLS *)
let[@inline always] new_key f = ref (f ())
let[@inline always] set k s = k := s
let[@inline always] get k = !k
end
end

let last_search_result_key = Domain.DLS.new_key (fun () -> [||])

let string_match re s pos =
Expand Down
4 changes: 2 additions & 2 deletions ocaml/runtime/caml/domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ int caml_try_run_on_all_domains_with_spin_work(
int sync,
void (*handler)(caml_domain_state*, void*, int, caml_domain_state**),
void* data,
void (*leader_setup)(caml_domain_state*),
void (*leader_setup)(caml_domain_state*, void*),
/* return nonzero if there may still be useful work to do while spinning */
int (*enter_spin_callback)(caml_domain_state*, void*),
void* enter_spin_data);
int caml_try_run_on_all_domains(
void (*handler)(caml_domain_state*, void*, int, caml_domain_state**),
void*,
void (*leader_setup)(caml_domain_state*));
void (*leader_setup)(caml_domain_state*, void*));

/* Function naming conventions for STW callbacks and STW critical sections.

Expand Down
3 changes: 2 additions & 1 deletion ocaml/runtime/caml/major_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extern gc_phase_t caml_gc_phase;
Caml_inline int caml_marking_started(void) {
return caml_gc_phase != Phase_sweep_main;
}
extern atomic_uintnat caml_gc_mark_phase_requested;

intnat caml_opportunistic_major_work_available (caml_domain_state*);
void caml_opportunistic_major_collection_slice (intnat);
Expand All @@ -45,7 +46,7 @@ void caml_teardown_major_gc(void);
void caml_darken(void*, value, volatile value* ignored);
void caml_darken_cont(value);
void caml_mark_root(value, value*);
void caml_empty_mark_stack(void);
void caml_mark_roots_stw(int, caml_domain_state**);
void caml_finish_major_cycle(int force_compaction);
#ifdef DEBUG
int caml_mark_stack_is_empty(void);
Expand Down
2 changes: 1 addition & 1 deletion ocaml/runtime/caml/minor_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ extern void caml_realloc_ephe_ref_table (struct caml_ephe_ref_table *);
extern void caml_realloc_custom_table (struct caml_custom_table *);
struct caml_minor_tables* caml_alloc_minor_tables(void);
void caml_free_minor_tables(struct caml_minor_tables*);
void caml_empty_minor_heap_setup(caml_domain_state* domain);
void caml_empty_minor_heap_setup(caml_domain_state* domain, void*);

#ifdef DEBUG
extern int caml_debug_is_minor(value val);
Expand Down
10 changes: 4 additions & 6 deletions ocaml/runtime/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,6 @@ struct domain_startup_params {

static void* backup_thread_func(void* v)
{
// single-domain hack
caml_fatal_error("backup thread not allowed to run");
dom_internal* di = (dom_internal*)v;
uintnat msg;
struct interruptor* s = &di->interruptor;
Expand Down Expand Up @@ -1591,7 +1589,7 @@ int caml_try_run_on_all_domains_with_spin_work(
int sync,
void (*handler)(caml_domain_state*, void*, int, caml_domain_state**),
void* data,
void (*leader_setup)(caml_domain_state*),
void (*leader_setup)(caml_domain_state*, void*),
int (*enter_spin_callback)(caml_domain_state*, void*),
void* enter_spin_data)
{
Expand Down Expand Up @@ -1659,7 +1657,7 @@ int caml_try_run_on_all_domains_with_spin_work(
}

if( leader_setup ) {
leader_setup(domain_state);
leader_setup(domain_state, data);
}

#ifdef DEBUG
Expand Down Expand Up @@ -1726,7 +1724,7 @@ int caml_try_run_on_all_domains_with_spin_work(
int caml_try_run_on_all_domains(
void (*handler)(caml_domain_state*, void*, int, caml_domain_state**),
void* data,
void (*leader_setup)(caml_domain_state*))
void (*leader_setup)(caml_domain_state*, void*))
{
return
caml_try_run_on_all_domains_with_spin_work(1,
Expand All @@ -1738,7 +1736,7 @@ int caml_try_run_on_all_domains(
int caml_try_run_on_all_domains_async(
void (*handler)(caml_domain_state*, void*, int, caml_domain_state**),
void* data,
void (*leader_setup)(caml_domain_state*))
void (*leader_setup)(caml_domain_state*, void*))
{
return
caml_try_run_on_all_domains_with_spin_work(0,
Expand Down
Loading
Loading