Bug 179112

Summary: 9.1 installer panics with a kmem_malloc() failure on i386 embedded systems
Product: Base System Reporter: Majdi S. Abbas <msa>
Component: i386Assignee: freebsd-stable (Nobody) <stable>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 9.1-RELEASE   
Hardware: Any   
OS: Any   

Description Majdi S. Abbas 2013-05-30 17:10:00 UTC
The 9.1 installer panics when kmem_malloc() fails on smaller embedded i386 architecture systems due to an autoscaling problem and CTL.  This is 100% reproducible until certain parameters are set via the loader during install:

 FreeBSD Installer
 ÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒ


                ÏÒÒÒÒÒÒÒÒÒÒÒÒArchive ExtractionÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÎ
                ¯                                             ¯
                ¯ base.txz                     [    57%     ] ¯
                ¯ kernel.txz                   [  Pending   ]panic: kmem_malloc(
4096): kmem_map too small: 38060032 total allocated           ¯
cpuid = 0       ¯ Extracting distribution files...            ¯
KDB: stack backtrace:                                         ¯
#0 0xc0af3aff at kdb_backtrace+0x4fssÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÎ  ¯
#1 0xc0ac052f at panic+0x16f          53%                  ¯  ¯
#2 0xc0d2caea at kmem_malloc+0x28aÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÍ  ¯
#3 0xc0d202b7 at page_alloc+0x27ÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÍ
#4 0xc0d22bca at keg_alloc_slab+0x10a
#5 0xc0d23164 at keg_fetch_slab+0xd4
#6 0xc0d234ec at zone_fetch_slab+0x4c
#7 0xc0d24ade at uma_zalloc_arg+0x4ae
#8 0xc0aab29a at malloc+0x5a
#9 0xc0ce922a at newjsegdep+0x2a
#10 0xc0cf5a89 at newjaddref+0x69
#11 0xc0cf5b16 at softdep_setup_inomapdep+0x56
#12 0xc0cd9398 at ffs_nodealloccg+0x728
#13 0xc0cd3d91 at ffs_hashalloc+0x41
#14 0xc0cd8913 at ffs_valloc+0x4a3
#15 0xc0d15c14 at ufs_makeinode+0xa4
#16 0xc0d164a0 at ufs_create+0x30
#17 0xc0e48412 at VOP_CREATE_APV+0x42
Uptime: 8m5s
Automatic reboot in 15 seconds - press a key on the console to abort
--> Press a key on the console to reboot,
--> or switch off the system now.

Fix: 

Set these parameters via the loader before booting the install image, and the install succeeds:

kern.cam.ctl.disable=1
vm.kmem_size_scale=1

Neither parameter, by itself, is enough for the install to complete, both are required.  Autoscaling appears to fail on smaller platforms.
How-To-Repeat: - Install FreeBSD 9.1/i386 from the USB installer image onto any i386 system with less than about 256 or 384M of DRAM.
Comment 1 Adrian Chadd freebsd_committer freebsd_triage 2013-06-05 18:59:21 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-stable

Punt to -stable, as this is not specifically an i386 issue.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-08-01 14:19:08 UTC
Author: marius
Date: Thu Aug  1 13:18:47 2013
New Revision: 253860
URL: http://svnweb.freebsd.org/changeset/base/253860

Log:
  MFC: r249410 (partial)
  
  Remove ctl(4) from GENERIC.
  
  With ctl(4) being built as a module and automatically loaded by ctladm(8),
  this makes CTL work out of the box.
  
  Note that unlike the original r249410, this commit does not remove the
  kern.cam.ctl.disable tunable for POLA reasons.
  
  PR:		174671, 175694, 179112
  Reviewed by:	ken (original version)
  Sponsored by:	FreeBSD Foundation (original version)
  Approved by:	re (hrs)

Modified:
  stable/9/sys/amd64/conf/GENERIC
  stable/9/sys/i386/conf/GENERIC
  stable/9/sys/i386/conf/PAE
  stable/9/sys/ia64/conf/GENERIC
  stable/9/sys/sparc64/conf/GENERIC
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/amd64/conf/GENERIC
==============================================================================
--- stable/9/sys/amd64/conf/GENERIC	Thu Aug  1 12:55:41 2013	(r253859)
+++ stable/9/sys/amd64/conf/GENERIC	Thu Aug  1 13:18:47 2013	(r253860)
@@ -124,7 +124,7 @@ device		sa		# Sequential Access (tape et
 device		cd		# CD
 device		pass		# Passthrough device (direct ATA/SCSI access)
 device		ses		# Enclosure Services (SES and SAF-TE)
-device		ctl		# CAM Target Layer
+#device		ctl		# CAM Target Layer
 
 # RAID controllers interfaced to the SCSI subsystem
 device		amr		# AMI MegaRAID

Modified: stable/9/sys/i386/conf/GENERIC
==============================================================================
--- stable/9/sys/i386/conf/GENERIC	Thu Aug  1 12:55:41 2013	(r253859)
+++ stable/9/sys/i386/conf/GENERIC	Thu Aug  1 13:18:47 2013	(r253860)
@@ -131,7 +131,7 @@ device		sa		# Sequential Access (tape et
 device		cd		# CD
 device		pass		# Passthrough device (direct ATA/SCSI access)
 device		ses		# Enclosure Services (SES and SAF-TE)
-device		ctl		# CAM Target Layer
+#device		ctl		# CAM Target Layer
 
 # RAID controllers interfaced to the SCSI subsystem
 device		amr		# AMI MegaRAID

Modified: stable/9/sys/i386/conf/PAE
==============================================================================
--- stable/9/sys/i386/conf/PAE	Thu Aug  1 12:55:41 2013	(r253859)
+++ stable/9/sys/i386/conf/PAE	Thu Aug  1 13:18:47 2013	(r253860)
@@ -39,8 +39,6 @@ nodevice	ncv
 nodevice	nsp
 nodevice	stg
 
-nodevice	ctl
-
 nodevice	asr
 nodevice	dpt
 nodevice	mly

Modified: stable/9/sys/ia64/conf/GENERIC
==============================================================================
--- stable/9/sys/ia64/conf/GENERIC	Thu Aug  1 12:55:41 2013	(r253859)
+++ stable/9/sys/ia64/conf/GENERIC	Thu Aug  1 13:18:47 2013	(r253860)
@@ -100,7 +100,7 @@ device		da		# Direct Access (ie disk)
 device		pass		# Passthrough (direct ATA/SCSI access)
 device		sa		# Sequential Access (ie tape)
 device		ses		# Enclosure Services (SES and SAF-TE)
-device		ctl		# CAM Target Layer
+#device		ctl		# CAM Target Layer
 
 # RAID controllers
 device		aac		# Adaptec FSA RAID

Modified: stable/9/sys/sparc64/conf/GENERIC
==============================================================================
--- stable/9/sys/sparc64/conf/GENERIC	Thu Aug  1 12:55:41 2013	(r253859)
+++ stable/9/sys/sparc64/conf/GENERIC	Thu Aug  1 13:18:47 2013	(r253860)
@@ -107,7 +107,7 @@ device		sa		# Sequential Access (tape et
 device		cd		# CD
 device		pass		# Passthrough device (direct ATA/SCSI access)
 device		ses		# SCSI Environmental Services (and SAF-TE)
-device		ctl		# CAM Target Layer
+#device		ctl		# CAM Target Layer
 
 # RAID controllers
 #device		amr		# AMI MegaRAID
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 3 Marius Strobl freebsd_committer freebsd_triage 2013-08-01 14:22:29 UTC
State Changed
From-To: open->closed

Close