Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Dec 2009 16:29:43 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/boot/i386/libi386 biosmem.c libi386.h src/sys/boot/i386/loader main.c
Message-ID:  <200912071629.nB7GTro8029666@repoman.freebsd.org>

index | next in thread | raw e-mail

jhb         2009-12-07 16:29:43 UTC

  FreeBSD src repository

  Modified files:
    sys/boot/i386/libi386 biosmem.c libi386.h 
    sys/boot/i386/loader main.c 
  Log:
  SVN rev 200219 on 2009-12-07 16:29:43Z by jhb
  
  Improve the algorithm the loader uses to choose a memory range for its
  heap when using a range above 1MB.
  
  Previously the loader would always use the last 3MB in the first memory
  range above 1MB for the heap.  However, this memory range is also where the
  kernel and any modules are loaded.  If this memory range is "small", then
  using the high 3MB for the heap may not leave enough room for the kernel
  and modules.
  
  Now the loader will use any range below 4GB for the heap, and the logic to
  choose the "high" heap region has moved into biosmem.c.  It sets two
  variables that the loader can use for a high heap if it desires.  When a
  high heap is enabled (BZIP2, FireWire, GPT, or ZFS), then the following
  memory ranges are preferred for the heap in order from best to worst:
  - The largest memory region in the SMAP with a start address greater than
    1MB.  The memory region must be at least 3MB in length.  This leaves the
    region starting at 1MB purely for use by the kernel and modules.
  - The last 3MB of the memory region starting at 1MB if it is at least 3MB
    in size.  This matches the current behavior except that the current loader
    would break horribly if the first region was not at least 3MB in size.
  - The memory range from the end of the loader up to the 640k window.  This
    is the range the loader uses when none of the high-heap-requesting options
    are enabled.
  
  Tested by:      hrs
  MFC after:      1 week
  
  Revision  Changes    Path
  1.11      +37 -2     src/sys/boot/i386/libi386/biosmem.c
  1.30      +2 -0      src/sys/boot/i386/libi386/libi386.h
  1.46      +10 -6     src/sys/boot/i386/loader/main.c


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912071629.nB7GTro8029666>