Skip to content

Commit

Permalink
Merge branch 'bjorn/remove-hybrid-heap/OTP-10105' into maint
Browse files Browse the repository at this point in the history
* bjorn/remove-hybrid-heap/OTP-10105:
  Remove stale code for hybrid heap and incremental GC
  Remove the hipe_bifs:show_message_area/0 BIF
  Remove support for erlang:system_info(global_heaps_size)
  Remove the erlang:garbage_collect_message_area/0 BIF
  Remove workarounds for hybrid and shared heaps in test suites
  • Loading branch information
garazdawi committed Jun 4, 2012
2 parents 9d590cf + 5c2dad4 commit 9cfeeb9
Show file tree
Hide file tree
Showing 63 changed files with 69 additions and 4,084 deletions.
18 changes: 0 additions & 18 deletions erts/Makefile.in
Expand Up @@ -31,21 +31,10 @@ ifeq ($(NO_START_SCRIPTS),)
ERTSDIRS += start_scripts
endif

# Until hybrid is nofrag, don't build it.
#BUILD_HYBRID_EMU=@ERTS_BUILD_HYBRID_EMU@
BUILD_HYBRID_EMU=no

EXTRA_FLAVORS=smp
ifeq ($(BUILD_HYBRID_EMU),yes)
EXTRA_FLAVORS += hybrid
endif

.PHONY: all
ifneq ($(BUILD_HYBRID_EMU),yes)
all: smp opt
else
all: hybrid smp opt
endif

.PHONY: docs
docs:
Expand All @@ -68,13 +57,6 @@ debug opt clean:
$(EXTRA_FLAVORS):
( cd emulator && $(MAKE) opt FLAVOR=$@ )

ifneq ($(BUILD_HYBRID_EMU),yes)
.PHONY: hybrid
hybrid:
@echo '*** Omitted build of hybrid heap emulator'
@echo '*** since target is $(TARGET)'
endif

# Make erl script and erlc in $(ERL_TOP)/bin which runs the compiled version
# Note that erlc is not a script and requires extra handling on cygwin.
# also note that this file is not created by autoconf, that's why @EXEEXT@
Expand Down
1 change: 0 additions & 1 deletion erts/autoconf/vxworks/sed.general
Expand Up @@ -70,7 +70,6 @@ s|@HCLIBS@||
s|@ENABLE_ALLOC_TYPE_VARS@||
s|@TERMCAP_LIB@||
s|@ERTS_BUILD_SMP_EMU@|no|
s|@ERTS_BUILD_HYBRID_EMU@|no|
s|@HAVE_VALGRIND@|no|
s|@EXEEXT@||
s|@WITH_SCTP@||
Expand Down
35 changes: 0 additions & 35 deletions erts/configure.in
Expand Up @@ -157,14 +157,6 @@ AS_HELP_STRING([--without-termcap],
[],
[with_termcap=yes])


AC_ARG_ENABLE(hybrid-heap,
AS_HELP_STRING([--enable-hybrid-heap], [enable hybrid heap]),
[ case "$enableval" in
no) enable_hybrid_heap=no ;;
*) enable_hybrid_heap=yes ;;
esac ], enable_hybrid_heap=unknown)

AC_ARG_ENABLE(lock-checking,
AS_HELP_STRING([--enable-lock-checking], [enable lock checking]),
[ case "$enableval" in
Expand Down Expand Up @@ -3133,33 +3125,6 @@ if test X${enable_tsp} = Xyes; then
fi
AC_SUBST(TSP_APP)

#
# Check if we should build hybrid emulator
#

AC_MSG_CHECKING([whether a hybrid heap emulator should be built])
case $enable_hybrid_heap-$host_os in
yes-*)
AC_MSG_RESULT([yes; enabled by user])
ERTS_BUILD_HYBRID_EMU=yes;;
no-*)
AC_MSG_RESULT([no; disabled by user])
ERTS_BUILD_HYBRID_EMU=no;;
*-win32|*-vxworks) # vxworks have their own "configure scripts"...
AC_MSG_RESULT([no; default on this platform])
ERTS_BUILD_HYBRID_EMU=no;;
*)
AC_MSG_RESULT([yes; default on this platform])
ERTS_BUILD_HYBRID_EMU=yes;;
esac


if test $ERTS_BUILD_HYBRID_EMU = yes; then
AC_DEFINE(ERTS_HAVE_HYBRID_EMU, 1, [Define if the hybrid emulator is built])
fi

AC_SUBST(ERTS_BUILD_HYBRID_EMU)

#
# Check if we should enable HiPE.
#
Expand Down
6 changes: 1 addition & 5 deletions erts/doc/src/erl.xml
Expand Up @@ -442,11 +442,7 @@
system with SMP support is available. <c>-smp auto</c> starts
the Erlang runtime system with SMP support enabled if it is
available and more than one logical processor are detected.
<c>-smp disable</c> starts a runtime system without SMP support.
By default <c>-smp auto</c> will be used unless a conflicting
parameter has been passed, then <c>-smp disable</c> will be
used. Currently only the <c>-hybrid</c> parameter conflicts
with <c>-smp auto</c>.</p>
<c>-smp disable</c> starts a runtime system without SMP support.</p>
<p><em>NOTE</em>: The runtime system with SMP support will not
be available on all supported platforms. See also the
<seealso marker="#+S">+S</seealso> flag.</p>
Expand Down
25 changes: 1 addition & 24 deletions erts/doc/src/erlang.xml
Expand Up @@ -4009,14 +4009,6 @@ os_prompt% </pre>
<p><c>Size</c> is the size in bytes of the process. This
includes call stack, heap and internal structures.</p>
</item>
<tag><c>{message_binary, BinInfo}</c></tag>
<item>
<p><c>BinInfo</c> is a list containing miscellaneous information
about binaries currently being referred to by the message
area. This <c>InfoTuple</c> is only valid on an emulator
using the hybrid heap type. This <c>InfoTuple</c> may be
changed or removed without prior notice.</p>
</item>
<tag><c>{message_queue_len, MessageQueueLen}</c></tag>
<item>
<p><c>MessageQueueLen</c> is the number of messages
Expand Down Expand Up @@ -5803,10 +5795,6 @@ ok
can spawn a process that does not use the default
settings.</p>
</item>
<tag><c>global_heaps_size</c></tag>
<item>
<p>Returns the current size of the shared (global) heap.</p>
</item>
<tag><c>heap_sizes</c></tag>
<item>
<p>Returns a list of integers representing valid heap sizes
Expand All @@ -5816,7 +5804,7 @@ ok
<tag><c>heap_type</c></tag>
<item>
<p>Returns the heap type used by the current emulator.
Currently the following heap types exist:</p>
Currently only the following heap type exists:</p>
<taglist>
<tag><c>private</c></tag>
<item>
Expand All @@ -5825,17 +5813,6 @@ ok
allowed. Messages passed between processes are copied
between heaps.</p>
</item>
<tag><c>shared</c></tag>
<item>
<p>One heap for use by all processes. Messages passed
between processes are passed by reference.</p>
</item>
<tag><c>hybrid</c></tag>
<item>
<p>A hybrid of the <c>private</c> and <c>shared</c> heap
types. A shared heap as well as private heaps are
used.</p>
</item>
</taglist>
</item>
<tag><c>info</c></tag>
Expand Down
6 changes: 0 additions & 6 deletions erts/doc/src/erlc.xml
Expand Up @@ -129,12 +129,6 @@
This option will be ignored by compilers that have a
a single output format.</p>
</item>
<tag>-hybrid</tag>
<item>
<p>Compile using the hybrid-heap emulator. This is mainly useful
for compiling native code, which needs to be compiled with the same
run-time system that it should be run on.</p>
</item>
<tag>-smp</tag>
<item>
<p>Compile using the SMP emulator. This is mainly useful
Expand Down
10 changes: 1 addition & 9 deletions erts/emulator/Makefile.in
Expand Up @@ -136,21 +136,13 @@ ENABLE_ALLOC_TYPE_VARS += smp nofrag
M4FLAGS += -DERTS_SMP=1
else

ifeq ($(FLAVOR),hybrid)
FLAVOR_MARKER=.hybrid
FLAVOR_FLAGS=-DHYBRID
ENABLE_ALLOC_TYPE_VARS += hybrid
else


# If flavor isn't one of the above, it *is* plain flavor...
override FLAVOR=plain
FLAVOR_MARKER=
FLAVOR_FLAGS=
ENABLE_ALLOC_TYPE_VARS += nofrag
M4FLAGS +=

endif
endif

TF_MARKER=$(TYPEMARKER)$(FLAVOR_MARKER)
Expand Down Expand Up @@ -748,7 +740,7 @@ RUN_OBJS = \
$(OBJDIR)/register.o $(OBJDIR)/break.o \
$(OBJDIR)/erl_async.o $(OBJDIR)/erl_lock_check.o \
$(OBJDIR)/erl_gc.o $(OBJDIR)/erl_lock_count.o \
$(OBJDIR)/erl_nmgc.o $(OBJDIR)/erl_posix_str.o \
$(OBJDIR)/erl_posix_str.o \
$(OBJDIR)/erl_bits.o $(OBJDIR)/erl_math.o \
$(OBJDIR)/erl_fun.o $(OBJDIR)/erl_bif_port.o \
$(OBJDIR)/erl_term.o $(OBJDIR)/erl_node_tables.o \
Expand Down
2 changes: 0 additions & 2 deletions erts/emulator/beam/atom.names
Expand Up @@ -244,7 +244,6 @@ atom gather_sched_wall_time_result
atom getting_linked
atom getting_unlinked
atom global
atom global_heaps_size
atom Gt='>'
atom grun
atom group_leader
Expand All @@ -259,7 +258,6 @@ atom hide
atom high
atom hipe_architecture
atom http httph https http_response http_request http_header http_eoh http_error http_bin httph_bin
atom hybrid
atom id
atom if_clause
atom imports
Expand Down
4 changes: 0 additions & 4 deletions erts/emulator/beam/beam_bif_load.c
Expand Up @@ -419,10 +419,8 @@ check_process_code(Process* rp, Module* modp)
Uint mod_size;
BeamInstr* end;
Eterm* sp;
#ifndef HYBRID /* FIND ME! */
struct erl_off_heap_header* oh;
int done_gc = 0;
#endif

#define INSIDE(a) (start <= (a) && (a) < end)

Expand Down Expand Up @@ -481,7 +479,6 @@ check_process_code(Process* rp, Module* modp)
* See if there are funs that refer to the old version of the module.
*/

#ifndef HYBRID /* FIND ME! */
rescan:
for (oh = MSO(rp).first; oh; oh = oh->next) {
if (thing_subtag(oh->thing_word) == FUN_SUBTAG) {
Expand All @@ -507,7 +504,6 @@ check_process_code(Process* rp, Module* modp)
}
}
}
#endif

/*
* See if there are constants inside the module referenced by the process.
Expand Down
55 changes: 0 additions & 55 deletions erts/emulator/beam/beam_emu.c
Expand Up @@ -26,7 +26,6 @@
#include "erl_vm.h"
#include "global.h"
#include "erl_process.h"
#include "erl_nmgc.h"
#include "error.h"
#include "bif.h"
#include "big.h"
Expand Down Expand Up @@ -253,20 +252,6 @@ void** beam_ops;
extern int count_instructions;
#endif

#if defined(HYBRID)
#define SWAPIN \
g_htop = global_htop; \
g_hend = global_hend; \
HTOP = HEAP_TOP(c_p); \
E = c_p->stop

#define SWAPOUT \
global_htop = g_htop; \
global_hend = g_hend; \
HEAP_TOP(c_p) = HTOP; \
c_p->stop = E

#else
#define SWAPIN \
HTOP = HEAP_TOP(c_p); \
E = c_p->stop
Expand Down Expand Up @@ -294,8 +279,6 @@ extern int count_instructions;

#define LIGHT_SWAPIN HTOP = HEAP_TOP(c_p)

#endif

#ifdef FORCE_HEAP_FRAGS
# define HEAP_SPACE_VERIFIED(Words) do { \
c_p->space_verified = (Words); \
Expand Down Expand Up @@ -457,36 +440,6 @@ extern int count_instructions;
CHECK_TERM(r(0)); \
} while (0)

#ifdef HYBRID
#ifdef INCREMENTAL
#define TestGlobalHeap(Nh, Live, hp) \
do { \
unsigned need = (Nh); \
ASSERT(global_heap <= g_htop && g_htop <= global_hend); \
SWAPOUT; \
reg[0] = r(0); \
FCALLS -= need; \
(hp) = IncAlloc(c_p,need,reg,(Live)); \
r(0) = reg[0]; \
SWAPIN; \
} while (0)
#else
#define TestGlobalHeap(Nh, Live, hp) \
do { \
unsigned need = (Nh); \
ASSERT(global_heap <= g_htop && g_htop <= global_hend); \
if (g_hend - g_htop < need) { \
SWAPOUT; \
reg[0] = r(0); \
FCALLS -= erts_global_garbage_collect(c_p, need, reg, (Live)); \
r(0) = reg[0]; \
SWAPIN; \
} \
(hp) = global_htop; \
} while (0)
#endif
#endif /* HYBRID */

#define Init(N) make_blank(yb(N))

#define Init2(Y1, Y2) do { make_blank(Y1); make_blank(Y2); } while (0)
Expand Down Expand Up @@ -1178,12 +1131,6 @@ void process_main(void)
*/
register Eterm* HTOP REG_htop = NULL;


#ifdef HYBRID
Eterm *g_htop;
Eterm *g_hend;
#endif

/* Stack pointer. Grows downwards; points
* to last item pushed (normally a saved
* continuation pointer).
Expand Down Expand Up @@ -6549,10 +6496,8 @@ new_fun(Process* p, Eterm* reg, ErlFunEntry* fe, int num_free)
hp = funp->env;
erts_refc_inc(&fe->refc, 2);
funp->thing_word = HEADER_FUN;
#ifndef HYBRID /* FIND ME! */
funp->next = MSO(p).first;
MSO(p).first = (struct erl_off_heap_header*) funp;
#endif
funp->fe = fe;
funp->num_free = num_free;
funp->creator = p->id;
Expand Down
32 changes: 0 additions & 32 deletions erts/emulator/beam/benchmark.c
Expand Up @@ -33,17 +33,6 @@ unsigned long long messages_copied;
unsigned long long messages_ego;
unsigned long long minor_gc;
unsigned long long major_gc;
#ifdef HYBRID
unsigned long long minor_global_gc;
unsigned long long major_global_gc;
unsigned long long gc_in_copy;
#ifdef INCREMENTAL
unsigned long long minor_gc_cycles;
unsigned long long major_gc_cycles;
unsigned long long minor_gc_stages;
unsigned long long major_gc_stages;
#endif
#endif
#endif /* BM_COUNTERS */

#ifdef BM_TIMERS
Expand Down Expand Up @@ -191,17 +180,6 @@ void init_benchmarking()
messages_ego = 0;
minor_gc = 0;
major_gc = 0;
#ifdef HYBRID
minor_global_gc = 0;
major_global_gc = 0;
gc_in_copy = 0;
#ifdef INCREMENTAL
minor_gc_cycles = 0;
major_gc_cycles = 0;
minor_gc_stages = 0;
major_gc_stages = 0;
#endif
#endif
#endif /* BM_COUNTERS */

#ifdef BM_HEAP_SIZES
Expand Down Expand Up @@ -243,16 +221,6 @@ void save_statistics()
erts_fprintf(file,"Number of processes spawned: %lld\n",processes_spawned);
erts_fprintf(file,"Number of local minor GCs: %lld\n",minor_gc);
erts_fprintf(file,"Number of local major GCs: %lld\n",major_gc);
#ifdef HYBRID
erts_fprintf(file,"Number of global minor GCs: %lld\n",minor_global_gc);
erts_fprintf(file,"Number of global major GCs: %lld\n",major_global_gc);
#ifdef INCREMENTAL
erts_fprintf(file,"Number of minor GC-cycles: %lld\n",minor_gc_cycles);
erts_fprintf(file,"Number of major GC-cycles: %lld\n",major_gc_cycles);
erts_fprintf(file,"Number of minor GC-stages: %lld\n",minor_gc_stages);
erts_fprintf(file,"Number of major GC-stages: %lld\n",major_gc_stages);
#endif
#endif
erts_fprintf(file,"Number of messages sent: %lld\n",messages_sent);
erts_fprintf(file,"Number of messages copied: %lld\n",messages_copied);
erts_fprintf(file,"Number of messages sent to self: %lld\n",messages_ego);
Expand Down

0 comments on commit 9cfeeb9

Please sign in to comment.