Bounce Buffer Panics

If you're seeing the message: panic: bounce memory out of range. This following message explains what's going on. I saw this problem on a machine with large (64MB) memory when I try to boot with a kernel with debugging information (i.e. kernel image > 10MB). A patch follows the message.

Date:      Tue, 15 Apr 1997 20:03:11 -0500 (EST)
From:      "John S. Dyson" 
To:        mrcpu@cdsnet.net (Jaye Mathisen)
Cc:        hackers@FreeBSD.ORG
Sender:    owner-hackers@FreeBSD.ORG
Subject:   Re: Doing the FreeBSD tightrope walk.

> 
> 
> Just about enough to make me switch sometimes...
> 
> P6-200, 128MB RAM.  -RELENG_2_2 supped from 4/13.
> 
> I'm getting a panic when doing a bunch of rm's via NFS.
> 
> So I build a kernel with -g, and now reboot, and now I panic with:
> 
> panic:  bounce memory out of range.
> 
> WTF is this?
> 
> All that's in this box is 2 7880's, and 2 dnet0 DEC DE500-AA's.
> 
> 
> Any tips appreciated.
> 
Turn off bounce buffer support.  There are some problems with
allocating too much bounce memory.  If you need bounce buffers,
inside of the bounce buffers calculation (#ifdef BOUNCE_BUFFERS)
where the number of bounce buffers are calculated in /sys/i386/i386/machdep.c,
limit the number of bouncepages to 128 instead of it's excessive value.

Good luck, and give me some feedback!!!

John

I made the change to my copy of the source. Here's the patch for the 2.2.2 Version.

*** machdep.c	Thu Dec  4 17:56:43 1997
--- /usr/src/sys/i386/i386/machdep.c	Thu Apr  3 01:37:31 1997
***************
*** 295,304 ****
  	 */
  	if (Maxmem > 4096) {
  		if (bouncepages == 0) {
! 			bouncepages = 64;			
  			bouncepages += ((Maxmem - 4096) / 2048) * 32;
- 			/* MAP - changed to limit bouncepages to 128 */
-  			bouncepages = ( bouncepages > 128 ? 128 : bouncepages);
  		}
  		v = (caddr_t)((vm_offset_t)round_page(v));
  		valloc(bouncememory, char, bouncepages * PAGE_SIZE);
--- 295,302 ----
  	 */
  	if (Maxmem > 4096) {
  		if (bouncepages == 0) {
! 			bouncepages = 64;
  			bouncepages += ((Maxmem - 4096) / 2048) * 32;
  		}
  		v = (caddr_t)((vm_offset_t)round_page(v));
  		valloc(bouncememory, char, bouncepages * PAGE_SIZE);


Other DiRT documents
Author: Mark Parris
Last updated: December 4, 1997