Changeset 11635


Ignore:
Timestamp:
Jan 21, 2009, 8:34:06 AM (11 years ago)
Author:
gb
Message:

The "experimental" setting for MAXIMUM_MAPPABLE_MEMORY for x8632 Linux
seems to work on a Fedora x8664 kernel, but it's too big for a 32-bit
Ubuntu 8.04 system. Try for a little over 2GB; need to leave some
memory for stacks/malloc/etc.

If allocate_dynamic_area() fails, print an error message and exit (rather
than segfaulting.)

#define MIN_DYNAMIC_SIZE (arbitrarily) as twice the default gc threshold.

In create_reserved_area(), ensure that the requested size is at least
as large as PURESPACE_RESERVE + MIN_DYNAMIC_SIZE. If the supplied size
would have been less than that, consider failure to be fatal (and exit).
In other cases, create_reserved_area() returns NULL on failure.

Expect ReserveMemoryForHeap?() to return NULL on failure (as it did until
a few hours ago.)

Keep calling create_reserved_area() until it succeeds or exits, trying
90% of the previous size on each subsequent attempt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r11633 r11635  
    402402#ifdef LINUX
    403403#ifdef X86
    404 #define MAXIMUM_MAPPABLE_MEMORY (3U<<30)
     404#define MAXIMUM_MAPPABLE_MEMORY (9U<<28)
    405405#else
    406406#define MAXIMUM_MAPPABLE_MEMORY (1U<<30)
     
    445445#endif
    446446
     447#define MIN_DYNAMIC_SIZE (DEFAULT_LISP_HEAP_GC_THRESHOLD *2)
     448
    447449#if (WORD_SIZE == 32)
    448450#define DEFAULT_INITIAL_STACK_SIZE (1<<20)
     
    572574    want = (BytePtr)IMAGE_BASE_ADDRESS;
    573575  area *reserved;
     576  Boolean fatal = false;
    574577
    575578  totalsize = align_to_power_of_2((void *)totalsize, log2_heap_segment_size);
     579   
     580  if (totalsize < (PURESPACE_RESERVE + MIN_DYNAMIC_SIZE)) {
     581    totalsize = PURESPACE_RESERVE + MIN_DYNAMIC_SIZE;
     582    fatal = true;
     583  }
    576584
    577585  start = ReserveMemoryForHeap(want, totalsize);
     586
     587  if (start == NULL) {
     588    if (fatal) {
     589      perror("minimal initial mmap");
     590      exit(1);
     591    }
     592    return NULL;
     593  }
    578594
    579595  h = (Ptr) start;
     
    661677  start = allocate_from_reserved_area(totalsize);
    662678  if (start == NULL) {
    663     return NULL;
     679    fprintf(dbgout, "reserved area too small to load heap image\n");
     680    exit(1);
    664681  }
    665682  end = start + totalsize;
     
    16161633  }
    16171634
    1618 
    1619   if (!create_reserved_area(reserved_area_size)) {
    1620     exit(-1);
    1621   }
     1635  while (1) {
     1636    if (create_reserved_area(reserved_area_size)) {
     1637      break;
     1638    }
     1639    reserved_area_size = reserved_area_size *.9;
     1640  }
     1641
    16221642  gc_init();
    16231643
Note: See TracChangeset for help on using the changeset viewer.