Changeset 2620

Show
Ignore:
Timestamp:
10/13/07 16:17:48 (1 year ago)
Author:
dhozac
Message:

Add support for the OOM bias in the configuration.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doc/configuration.xml

    r2614 r2620  
    667667      </description> 
    668668    </data> 
     669    <scalar name="badness"> 
     670      <description> 
     671Contains the bias to be applied to processes in this guest when the OOM-killer strikes. 
     672      </description> 
     673    </scalar> 
    669674     
    670675    <collection name="apps"> 
  • trunk/scripts/vserver.functions

    r2617 r2620  
    4646declare -a OPTS_VTAG_CREATE=() 
    4747declare -a OPTS_VTAG_ENTER=() 
     48declare -a OPTS_VMEMCTRL=() 
    4849 
    4950declare -a STOPCMD_PREPARE=() 
     
    607608} 
    608609 
    609 function _generateTagOptions 
    610 { 
    611     local vdir="$1" 
    612     local tag 
    613  
    614     getFileValue tag "$vdir/tag" "$vdir/context" 
    615     test -n "$tag" || return 0 
    616  
    617     OPTS_VTAG_CREATE=( --tag "$tag" ) 
    618     OPTS_VTAG_ENTER=( --tag "$tag" ) 
    619 } 
    620  
    621610function enableInterfaces 
    622611{ 
     
    689678} 
    690679 
     680function _generateTagOptions 
     681{ 
     682    local vdir="$1" 
     683    local tag 
     684 
     685    getFileValue tag "$vdir/tag" "$vdir/context" 
     686    test -n "$tag" || return 0 
     687 
     688    OPTS_VTAG_CREATE=( --tag "$tag" ) 
     689    OPTS_VTAG_ENTER=( --tag "$tag" ) 
     690} 
     691 
     692function _generateMemctrlOptions 
     693{ 
     694    local vdir="$" 
     695    local badness 
     696 
     697    getFileValue badness "$vdir/badness" 
     698    test -n "$badness" || return 0 
     699 
     700    OPTS_VMEMCTRL=( --badness "$badness" ) 
     701} 
     702 
    691703## Usage: prepareInit <vserver-directory> 
    692704function prepareInit 
     
    733745    _generatePersonalityOptions "$1" 
    734746    _generateTagOptions         "$1" 
     747    _generateMemctrlOptions     "$1" 
    735748 
    736749    if test -n "$_IS_FAKEINIT"; then 
  • trunk/scripts/vserver.start

    r2617 r2620  
    143143    $_VSYSCTL    --xid self --dir "$VSERVER_DIR"/sysctl --missingok -- \ 
    144144    $_VUNAME     --xid self --dir "$VSERVER_DIR"/uts    --missingok -- \ 
     145    $_VMEMCTRL   --xid self "${OPTS_VMEMCTRL[@]}" -- \ 
    145146    "${VSERVER_EXTRA_CMDS[@]}" \ 
    146147    $_VUNAME     --xid self --set -t context="$VSERVER_DIR" -- \