From nobody@FreeBSD.org  Thu Jun 14 20:21:23 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 1F4B537B401
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Jun 2001 20:21:22 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.3/8.11.3) id f5F3LM079019;
	Thu, 14 Jun 2001 20:21:22 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200106150321.f5F3LM079019@freefall.freebsd.org>
Date: Thu, 14 Jun 2001 20:21:22 -0700 (PDT)
From: Simon Shapiro <shimon@simon-shapiro.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: RELENG_4 (4.2, 4.3) Panics when system has 2GB of memory (SWAP)
X-Send-Pr-Version: www-1.0

>Number:         28162
>Category:       kern
>Synopsis:       RELENG_4 (4.2, 4.3) Panics when system has 2GB of memory (SWAP)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 14 20:30:02 PDT 2001
>Closed-Date:    Sun Jun 02 04:18:46 PDT 2002
>Last-Modified:  Sun Jun 02 04:18:46 PDT 2002
>Originator:     Simon Shapiro
>Release:        4.2, 4.3, RELENG_4 (as of today)
>Organization:
>Environment:
FreeBSD nomis.simon-shapiro.org 4.3-20010522-STABLE FreeBSD 4.3-20010522-STABLE #10: Thu Jun 14 22:14:16 EDT 2001     root@:/usr/src/RELENG_4/src/sys/compile/NOMIS-smp  i386

>Description:
/usr/src/sys/vm/swap_pager.c, line 310 or thereabout calls zinit.
zinit returns NULL because it calls zinita with too large a number.

I tried to force the value down but that only helps in SMP.
A UP kernel still crashes.

I forced the value down like this:

	if ((swap_zone = zinit( "SWAPMETA", sizeof(struct swblock), 
	    			n, ZONE_INTERRUPT, 1 )) == NULL) {
		int m = 127332; /* This number is from 256MB system */

		printf("%s.%s(%d) ERROR:  swap_zone is NULL\n"
			"    Reducing n from %d to %d\n",
			__FILE__, __FUNCTION__, __LINE__,
			n, m);

		if ((swap_zone = zinit( "SWAPMETA", sizeof(struct swblock), 
	    			m, ZONE_INTERRUPT, 1 )) == NULL) {
			panic("swap_pager_swap_init: swap_zone == NULL");
		}

		n = m; /* Prevents failure and panic */
	}


NOTE:  The above snippet is _not_ a fix.

>How-To-Repeat:
Boot on a Pentium III with 2 or 4 GB of RAM.
>Fix:
Not sure.  The code needs to be re-written to examine how much 
memory is really there.  I did not have this problem, in the identical
machine, in RELENG_3.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: iedowse 
State-Changed-When: Sun Dec 2 16:33:55 PST 2001 
State-Changed-Why:  

Does this still occur with a recent -stable? I seem to remember 
seeing some fixes in this area committed. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28162 

From: "Hiten Pandya" <hitmaster@mysun.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc: shimon@simon-shapiro.com
Subject: Re: kern/28162: RELENG_4 (4.2, 4.3) Panics when system has 2GB
 of memory (SWAP)
Date: Mon, 21 Jan 2002 15:49:02 GMT

 > Does this still occur with a recent -stable? I seem to remember 
 > seeing some fixes in this area committed. 
 
 This issue has been discussed in the FreeBSD -hackers, -stable, and
 -current mailing lists, at great lengths, and there are various patches
 for -current and -stable submitted by Matt Dillon regarding this issue.
 
 I personally also have followed-up to PRs regarding this issue.  
 Solution(s) to this problem can be found in the mailing lists pointed
 above.
 
 This PR can be successfully closed if there are no more issues 
 regarding this matter.
 
 thanks,
 regards,
 Hiten Pandya
 <hiten@uk.FreeBSD.org>
 <hitmaster@mysun.com>
 
 Security Fingerprint:
 45 a5 9c f2 fb 07 da 70 18 02 0b f3 63 f1 7a a6 hitenp@hpdi.ath.cx
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: iedowse 
State-Changed-When: Sun Jun 2 04:18:20 PDT 2002 
State-Changed-Why:  

Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=28162 
>Unformatted:
