On Thu, Jun 24, 2010 at 4:11 PM, Dennis Clarke <dcla...@blastwave.org>wrote:

>
> > *Hi,
> >
> > I am working on Opensolaris build128 (64bit)on a Intel system
> > with 6GB of memory. Out of that, I would like to use first 1GB
> > for solaris. I have set physmem=0x40000 as the boot argument.
>
> Well two things come to mind.
>
> Firstly I was not aware you could set that value as a parameter via boot.
> I think you need to put that into /etc/system and not as a param via some
> grub boot line.  Even then that DOES NOT WORK. See below.
>

It can be set as a prop=val option for the kernel image in the grub.

>
> Secondly it is pages of memory. I have never tried using physmem to
> constrain memory pages because I generally just rip the memory out of the
> machine and do it the old fashioned way.
>
> http://docs.sun.com/app/docs/doc/817-0404/chapter2-1?a=view
>

Thanks for the link. I  have read the before.

>
> physmem
>
> Description
>
>    Modifies the system's configuration of the number of physical pages of
> memory after the Solaris OS and firmware are accounted for.
> Data Type
>
>    Unsigned long
> Default
>
>    Number of usable pages of physical memory available on the system, not
> counting the memory where the core kernel and data are stored
> Range
>
>    1 to amount of physical memory on system
> Units
>
>    Pages
> Dynamic?
>
>    No
> Validation
>
>    None
> When to Change
>
>    Whenever you want to test the effect of running the system with less
> physical memory. Because this parameter does not take into account the
> memory used by the core kernel and data, as well as various other data
> structures allocated early in the startup process, the value of
> physmem should be less than the actual number of pages that represent
> the smaller amount of memory.
> Commitment Level
>
>    Unstable
>
> Some values I tend to look at or tweak from time to time for fun and profit
> :
>
> r...@aequitas:/root# mdb -k
> Loading modules: [ unix genunix specfs mac cpu.generic uppc pcplusmp
> rootnex scsi_vhci ufs ip hook neti sockfs arp usba uhci stmf fctl nca lofs
> zfs idm cpc random crypto nfs fcip ptm sppp ]
> > physmem/D
> physmem:
> physmem:        243326
> > pagesize/D
> mdb: failed to dereference symbol: unknown symbol name
> > lotsfree/D
> lotsfree:
> lotsfree:       3801
> > desfree/D
> desfree:
> desfree:        1900
> > minfree/D
> minfree:
> minfree:        950
> > throttlefree/D
> throttlefree:
> throttlefree:   950
> > pageout_reserve/D
> pageout_reserve:
> pageout_reserve:475
> > tune_t_minarmem/D
> tune_t_minarmem:
> tune_t_minarmem:25
> > handspreadpages/D
> handspreadpages:
> handspreadpages:52819
> > swapfs_reserve/D
> swapfs_reserve:
> swapfs_reserve: 1900
> > moddebug/D
> moddebug:
> moddebug:       0
> > maxphys/D
> maxphys:
> maxphys:        57344
> >
>
> Since this is an x86 machine I have a pagesize of 4096 bytes. Let's verify
> that :
>
> r...@aequitas:/root# prtconf -v | grep Memory
> Memory size: 959 Megabytes
> r...@aequitas:/root#
> r...@aequitas:/root# bc
> scale=6
> 4096 * 243326
> 996663296
>
> Funny because the machine really has 1G of memory in it.
>
> > physmem/X
> physmem:
> physmem:        3b67e
>
> Oh well, your value of 0x40000 should work in /etc/system. Let me try with
> 256MB of memory and see what I get.
>
> Here is my /etc/system just for laughs : ( note the broken weird first
> line .. I didn't do that )
>
> *ident  "%Z%%M% %I%     %E% SMI" /* SVR4 1.5 */
> *
> * CDDL HEADER START
> *
> * The contents of this file are subject to the terms of the
> * Common Development and Distribution License, Version 1.0 only
> * (the "License").  You may not use this file except in compliance
> * with the License.
> *
> * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
> * or http://www.opensolaris.org/os/licensing.
> * See the License for the specific language governing permissions
> * and limitations under the License.
> *
> * When distributing Covered Code, include this CDDL HEADER in each
> * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
> * If applicable, add the following below this CDDL HEADER, with the
> * fields enclosed by brackets "[]" replaced with your own identifying
> * information: Portions Copyright [yyyy] [name of copyright owner]
> *
> * CDDL HEADER END
> *
> *
> * SYSTEM SPECIFICATION FILE
> *
> **********************************************************************
> *
> *       Description : physmem
> *
> *           Modifies the system's configuration of the number of
> *           physical pages of memory after the Solaris OS and
> *           firmware are accounted for.
> *
> *       Data Type : Unsigned long
> *
> *       Default :
> *
> *           Number of usable pages of physical memory available on
> *           the system, not counting the memory where the core
> *           kernel and data are stored
> *
> *       Range : 1 to amount of physical memory on system
> *
> *       Units : Pages
> *
> *       When to Change :
> *
> *           Whenever you want to test the effect of running the
> *           system with less physical memory. Because this
> *           parameter does not take into account the memory used
> *           by the core kernel and data, as well as various other
> *           data structures allocated early in the startup process,
> *           the value of physmem should be less than the actual
> *           number of pages that represent the smaller amount of
> *           memory.
> *
>
> set physmem=65536
>
> ***********************************************************************
> *
> *       Description :  reserved_procs
> *
> *           Specifies number of system process slots to be reserved
> *           in the process table for processes with a UID of root (0)
> *
> *           Consider increasing to 10 + normal number of UID 0 (root)
> *           processes on system. This setting provides some cushion
> *           should it be necessary to obtain a root shell during a time
> *           when the system is otherwise unable to create user-level
> *           processes.
> *
>
> set reserved_procs = 32
>
>
> ******************************************************************************
> *
> *       Description :  pt_cnt
> *
> *           The number of available /dev/pts entries is dynamic up to
> *           a limit determined by the amount of physical memory
> *           available on the system.
> *
> *           pt_cnt is one of three variables that determines the
> *           minimum number of logins that the system can accommodate.
> *           The default maximum number of /dev/pts devices the system
> *           can support is determined at boot time by computing the
> *           number of pty structures that can fit in a percentage of
> *           system memory (see pt_pctofmem). If pt_cnt is zero, the
> *           system allocates up to that maximum. If pt_cnt is non-zero,
> *           the system allocates to the greater of pt_cnt and the
> *           default maximum.
> *
> *       Data Type : Unsigned integer
> *       Default   : 0
> *       Range     : 0 to maxpid
> *       Units     : Logins/windows
> *       Dynamic?  : No
> *       Validation: None
> *
> *       When to Change
> *
> *           When you want to explicitly control the number of users
> *           who can remotely log in to the system.
>
> * Note from Dennis Clarke : we may want to throttle this later
>
> * set pt_cnt = 32
>
>
> ******************************************************************************
> *
> *       Description :  pt_pctofmem
> *
> *           Specifies maximum percentage of physical memory that
> *           can be consumed by data structures to support /dev/pts
> *           entries.
> *
> *           A system running a 64-bit kernel consumes 176 bytes
> *           per /dev/pts entry. A system running a 32-bit kernel
> *           consumes 112 bytes per /dev/pts entry.
> *
> *       Default = 5 percent
> *
>
> * Note from Dennis Clarke : It may be necessary to set this to a value
> *                       higher than 5% on a really small machine.
> *                       Great for embedded devices right.
> * set pt_pctofmem = 10
>
>
> ******************************************************************************
> *
> *       Description :  pt_max_pty
> *
> *           Defines the maximum number of ptys the system offers.
> *
> *           Data Type :  Unsigned integer
> *
> *           Default = 0 (Uses system-defined maximum)
> *
> *           Range : 0 to MAXUINT
> *
> *           Units is number of Logins/windows
> *
> *           Dynamic? = Yes
> *
> *           Validation : None
> *
> *           Implicit
> *
> *               Should be greater than or equal to pt_cnt.  Value is not
> *               checked until the number of ptys allocated exceeds the
> *               value of pt_cnt.
> *
> *           When to Change
> *
> *               When you want to place an absolute ceiling on the number
> *               of logins supported, even if the system could handle more
> *               based on its current configuration values.
>
> * Note from Dennis Clarke : You may want to limit this someday.
> *                         : But not today.
> * set pt_max_pty = 64
>
>
> ******************************************************************************
> *
> *       Description :  pidmax
> *
> *           This parameter specifies value of largest possible process ID.
> *           pidmax sets the value for the maxpid variable. Once maxpid is
> *           set, pidmax is ignored. maxpid is used elsewhere in the kernel
> *           to determine the maximum process ID and for constraint
> *           checking.  Attempts to set maxpid by adding an entry to the
> *           /etc/system file have no effect.
> *
>
> * Note from Dennis Clarke : I have used this in the past when testing a new
> *                     : kernel build on a really small machine. If this
> *                     : value is set too low then you can have a wild
> *                     : set of errors at boot time. Don't touch it !
>
> * set pidmax = 32767 <-- not really recommended
>
>
> ******************************************************************************
> *
> *       Description :  max_nprocs
> *
> *           Maximum number of processes that can be created on a system.
> *           Includes system and user processes. Any value entered in
> *           /etc/system is used in the computation of maxuprc.
> *
> *           This value is also used in determining the size of several
> *           other system data structures. Other data structures where
> *           this variable plays a role are:
> *
> *               - Determining the size of the directory name lookup
> *                 cache (if ncsize is not specified).
> *
> *               - Allocating disk quota structures for UFS
> *                 (if ndquot is not specified).
> *
> *               - Verifying that the amount of memory used by
> *                 configured system V semaphores does not exceed
> *                 system limits.
> *
> *               - Configuring Hardware Address Translation resources
> *                 for the sun4m and Intel platforms.
> *
>
> set max_nprocs = 512
>
>
> ******************************************************************************
> *
> *       Description :  maxuprc
> *
> *           Maximum number of processes that can be created on a system
> *           by any one user.
> *
> *           Data Type  : Signed integer
> *
> *           Default    : max_nprocs - reserved_procs
> *
> *           Range      : 1 to max_nprocs - reserved_procs
> *
> *           Validation : Compared to max_nprocs - reserved_procs and
> *                        then set to the smaller of the two.
> *
> *           When you want to specify a hard limit for the number of
> *           processes a user can create that is less than the default
> *           value of however many processes the system can create.
> *           Attempting to exceed this limit generates the following
> *           warning messages on the console or in the messages file:
> *
> *                     out of per-user processes for uid N
> *
>
> set maxuprc = 64
>
>
> ******************************************************************************
> *
> *       Description :  md_mirror:md_resync_bufsz
> *
> *           To override the default buffer_size value used by the
> *           svc:/system/mdmonitor service, you can edit /etc/system
> *           to specify:
> *
> *                set md_mirror:md_resync_bufsz = 2048
> *
> *           Such that resyncs occur as quickly as possible.
> *
> *           See metasync(1M)
> *
>
> set md_mirror:md_resync_bufsz = 2048
>
>
> ******************************************************************************
> *
> * Requested by Oracle DBA for reasons unknown
> *
> * set shmsys:shminfo_shmmax = 4294967295
> * set shmsys:shminfo_shmseg = 1024
> * set shmsys:shminfo_shmmni = 1024
> * set semsys:seminfo_semaem = 16384
> * set semsys:seminfo_semmni = 1024
> * set semsys:seminfo_semmap = 1026
> * set semsys:seminfo_semmns = 16384
> * set semsys:seminfo_semmsl = 100
> * set semsys:seminfo_semopm = 100
> * set semsys:seminfo_semmnu = 2048
> * set semsys:seminfo_semume = 256
> * set msgsys:msginfo_msgmap = 1026
> *  other bizarre black magic may be requested but simply is not
> *  needed on a modern Solaris or OpenSolaris server. I mean really.
>
> ******************************************************************************
>
> system reboots now ...
>
>
> Shutdown started.    Thu Jun 24 23:05:58 GMT 2010
>
> Changing to init state 6 - please wait
> Broadcast Message from root (pts/1) on aequitas Thu Jun 24 23:05:59...
> THE SYSTEM aequitas IS BEING SHUT DOWN NOW ! ! !
> Log off now or risk your files being damaged
>
> showmount: aequitas: RPC: Program not registered
> updating //platform/i86pc/boot_archive
> updating //platform/i86pc/amd64/boot_archive
> .
> .
> .
> r...@aequitas:/root# uptime
>  23:11pm  up   0:03,  1 user,  load average: 1.74, 1.63, 0.73
> r...@aequitas:/root# mdb -k
> Loading modules: [ unix genunix specfs dtrace mac cpu.generic uppc
> pcplusmp rootnex scsi_vhci ufs ip hook neti sockfs arp usba uhci stmf fctl
> nca lofs zfs md random idm cpc crypto nfs fcip ptm sppp ]
> > physmem/D
> physmem:
> physmem:        243326
> > physmem/X
> physmem:
> physmem:        3b67e
> >
> r...@aequitas:/root# grep physmem /etc/system
> *           the value of physmem should be less than the actual
> set physmem=65536
>
>
> Well lo and behold, the boot process seems to ignore the physmem
> setting in /etc/system.
>

I assume the reason your physmem setting in /etc/system was not honored
because of
the following code in param_check().

#if defined(__x86)
        if (physmem != original_physmem) {
                cmn_err(CE_NOTE, "physmem cannot be modified to 0x%lx"
                    " via /etc/system. Please use eeprom(1M) instead.",
                    physmem);
                physmem = original_physmem;
        }
#endif


Really appreciate your comments.

Thanks
Anup


>
> --
> Dennis Clarke
> dcla...@opensolaris.ca  <- Email related to the open source Solaris
> dcla...@blastwave.org   <- Email related to open source for Solaris
>
>
>
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to