NetBSD Problem Report #47093

From www@NetBSD.org  Fri Oct 19 23:03:07 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id B7B1963DFCB
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 19 Oct 2012 23:03:07 +0000 (UTC)
Message-Id: <20121019230306.CDD0563DFAE@www.NetBSD.org>
Date: Fri, 19 Oct 2012 23:03:06 +0000 (UTC)
From: james.r.harris@intel.com
Reply-To: james.r.harris@intel.com
To: gnats-bugs@NetBSD.org
Subject: Fragmented memory map panics NetBSD install (VM_PHYSSEG_MAX)
X-Send-Pr-Version: www-1.0

>Number:         47093
>Category:       port-amd64
>Synopsis:       Fragmented memory map panics NetBSD install (VM_PHYSSEG_MAX)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 19 23:05:00 +0000 2012
>Closed-Date:    Fri Feb 10 10:42:09 +0000 2017
>Last-Modified:  Fri Feb 10 10:42:09 +0000 2017
>Originator:     Jim Harris
>Release:        6.0
>Organization:
Intel
>Environment:
>Description:
I have a Sandy Bridge Xeon system which has a rather fragmented memory map.  After the initial installation menu, I get an immediate panic and reboot.  The full message is:

panic: add_mem_cluster: too many memory segments (increase VM_PHYSSEG_MAX)

Sure enough, VM_PHYSSEG_MAX is defined to 16 on x86, but my system has 20+ entries.

Physical memory chunk(s):
0x0000000000010000 - 0x0000000000041fff, 204800 bytes (50 pages)
0x0000000000052000 - 0x0000000000097fff, 286720 bytes (70 pages)
0x0000000000100000 - 0x00000000001fffff, 1048576 bytes (256 pages)
0x0000000000ef5000 - 0x0000000076d59fff, 1978028032 bytes (482917 pages)
0x000000007a8d7000 - 0x000000007a96dfff, 618496 bytes (151 pages)
0x000000007a971000 - 0x000000007a9b2fff, 270336 bytes (66 pages)
0x000000007a9b4000 - 0x000000007a9bcfff, 36864 bytes (9 pages)
0x000000007a9be000 - 0x000000007aa6efff, 724992 bytes (177 pages)
0x000000007aa71000 - 0x000000007aacefff, 385024 bytes (94 pages)
0x000000007aaf0000 - 0x000000007ac02fff, 1126400 bytes (275 pages)
0x000000007ac13000 - 0x000000007ac74fff, 401408 bytes (98 pages)
0x000000007ac79000 - 0x000000007ac8cfff, 81920 bytes (20 pages)
0x000000007ac91000 - 0x000000007acb5fff, 151552 bytes (37 pages)
0x000000007acc6000 - 0x000000007accffff, 40960 bytes (10 pages)
0x000000007acfc000 - 0x000000007ad93fff, 622592 bytes (152 pages)
0x000000007ad9b000 - 0x000000007adcefff, 212992 bytes (52 pages)
0x000000007b0d0000 - 0x000000007b161fff, 598016 bytes (146 pages)
0x000000007b166000 - 0x000000007b193fff, 188416 bytes (46 pages)
0x000000007b19c000 - 0x000000007b26bfff, 851968 bytes (208 pages)
0x000000007b27f000 - 0x000000007b294fff, 90112 bytes (22 pages)
0x000000007b299000 - 0x000000007b2c7fff, 192512 bytes (47 pages)
0x000000007b2cb000 - 0x000000007b2fffff, 217088 bytes (53 pages)
0x000000007b308000 - 0x000000007d957fff, 40173568 bytes (9808 pages)
0x000000007db58000 - 0x000000007db5cfff, 20480 bytes (5 pages)
0x000000007db60000 - 0x000000007dcd5fff, 1531904 bytes (374 pages)
0x000000007dfad000 - 0x000000007dfe7fff, 241664 bytes (59 pages)

>How-To-Repeat:

>Fix:
Increase VM_PHYSSEG_MAX from 16 to (at least) 32 in:

sys/arch/i386/include/vmparam.h
sys/arch/amd64/include/vmparam.h


>Release-Note:

>Audit-Trail:
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-amd64/47093: Fragmented memory map panics NetBSD install (VM_PHYSSEG_MAX)
Date: Sat, 20 Oct 2012 09:58:15 +0100

 On Fri, Oct 19, 2012 at 11:05:00PM +0000, james.r.harris@intel.com wrote:
 > >Number:         47093
 > >Category:       port-amd64
 > >Synopsis:       Fragmented memory map panics NetBSD install (VM_PHYSSEG_MAX)
 ...
 > I have a Sandy Bridge Xeon system which has a rather fragmented memory map.
 > After the initial installation menu, I get an immediate panic and reboot.
 > The full message is:
 > 
 > panic: add_mem_cluster: too many memory segments (increase VM_PHYSSEG_MAX)
 > 
 > Sure enough, VM_PHYSSEG_MAX is defined to 16 on x86,
 > but my system has 20+ entries.
 > 
 > Physical memory chunk(s):
 > 0x0000000000010000 - 0x0000000000041fff, 204800 bytes (50 pages)
 > 0x0000000000052000 - 0x0000000000097fff, 286720 bytes (70 pages)
 > 0x0000000000100000 - 0x00000000001fffff, 1048576 bytes (256 pages)
 > 0x0000000000ef5000 - 0x0000000076d59fff, 1978028032 bytes (482917 pages)
 > 0x000000007a8d7000 - 0x000000007a96dfff, 618496 bytes (151 pages)
 > 0x000000007a971000 - 0x000000007a9b2fff, 270336 bytes (66 pages)
 > 0x000000007a9b4000 - 0x000000007a9bcfff, 36864 bytes (9 pages)
 > 0x000000007a9be000 - 0x000000007aa6efff, 724992 bytes (177 pages)
 > 0x000000007aa71000 - 0x000000007aacefff, 385024 bytes (94 pages)
 > 0x000000007aaf0000 - 0x000000007ac02fff, 1126400 bytes (275 pages)
 > 0x000000007ac13000 - 0x000000007ac74fff, 401408 bytes (98 pages)
 > 0x000000007ac79000 - 0x000000007ac8cfff, 81920 bytes (20 pages)
 > 0x000000007ac91000 - 0x000000007acb5fff, 151552 bytes (37 pages)
 > 0x000000007acc6000 - 0x000000007accffff, 40960 bytes (10 pages)
 > 0x000000007acfc000 - 0x000000007ad93fff, 622592 bytes (152 pages)
 > 0x000000007ad9b000 - 0x000000007adcefff, 212992 bytes (52 pages)
 > 0x000000007b0d0000 - 0x000000007b161fff, 598016 bytes (146 pages)
 > 0x000000007b166000 - 0x000000007b193fff, 188416 bytes (46 pages)
 > 0x000000007b19c000 - 0x000000007b26bfff, 851968 bytes (208 pages)
 > 0x000000007b27f000 - 0x000000007b294fff, 90112 bytes (22 pages)
 > 0x000000007b299000 - 0x000000007b2c7fff, 192512 bytes (47 pages)
 > 0x000000007b2cb000 - 0x000000007b2fffff, 217088 bytes (53 pages)
 > 0x000000007b308000 - 0x000000007d957fff, 40173568 bytes (9808 pages)
 > 0x000000007db58000 - 0x000000007db5cfff, 20480 bytes (5 pages)
 > 0x000000007db60000 - 0x000000007dcd5fff, 1531904 bytes (374 pages)
 > 0x000000007dfad000 - 0x000000007dfe7fff, 241664 bytes (59 pages)
 > 
 > >How-To-Repeat:
 > 
 > >Fix:
 > Increase VM_PHYSSEG_MAX from 16 to (at least) 32 in:

 An alternate/additional fix would be to ignore the smallest segments.
 Only two of the above block are really worth having!

 	David

 -- 
 David Laight: david@l8s.co.uk

From: "Maxime Villard" <maxv@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47093 CVS commit: src/sys/arch/x86/x86
Date: Fri, 10 Feb 2017 10:39:37 +0000

 Module Name:	src
 Committed By:	maxv
 Date:		Fri Feb 10 10:39:36 UTC 2017

 Modified Files:
 	src/sys/arch/x86/x86: x86_machdep.c

 Log Message:
 If the segment list is full, print a warning on the console and launch the
 system with the available segments.

 High memory systems may have more than VM_PHYSSEG_MAX segments; it is
 better to truncate the memory and allow the system to work rather than
 just panicking. The user can still increase VM_PHYSSEG_MAX (or ask us to).

 Fixes issues such as PR/47093.

 Note: the warning is logged but does not appear in dmesg, this too needs
 to be fixed for the rest of the bootstrap procedure.


 To generate a diff of this commit:
 cvs rdiff -u -r1.86 -r1.87 src/sys/arch/x86/x86/x86_machdep.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maxv@NetBSD.org
State-Changed-When: Fri, 10 Feb 2017 10:42:09 +0000
State-Changed-Why:
fixed - and the value got increased to 32 in the meantime anyway


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.