+ All Categories
Home > Documents > Process Management in Solaris

Process Management in Solaris

Date post: 05-Jul-2018
Category:
Upload: anonymous-xv3sijz8b
View: 215 times
Download: 0 times
Share this document with a friend

of 22

Transcript
  • 8/15/2019 Process Management in Solaris

    1/22

  • 8/15/2019 Process Management in Solaris

    2/22

    Introduction to Solaris

    Developed in 1987 by AT&T and Sun Microsystems

    !ompatible "it# SPA$! arc#itecture

    %penSolaris "as t#e %pen Source version o t#e Solaris operating system"#ic# #as been discontinued ater %racle too' over in ()1)

    %S amily* +ni,

    Programmed in * ! Deault +I* -.%M/

    Mi,ed Source0 %nly certain eatures are open source

  • 8/15/2019 Process Management in Solaris

    3/22

    Process

    T#e most basic abstraction provided by an %perating System

    A process is an e,ecutable obect located at p#ysical memory pages

    /very process #as its o"n uni2ue integer number called Process ID

  • 8/15/2019 Process Management in Solaris

    4/22

    Solaris 3ernel T#reads

    A thread is an independent lo" o control t#at operates "it#in t#e sameaddress space as ot#er independent lo"s o control "it#in a process

    Solaris is a multi0t#read %perating System4 t#at is every tas' perormed ise,ecuted li'e a 'ernel t#read

    %n a single processor4 multit#reading is generally implemented by time0division multiple,ing 5as in multitas'ing6* t#e processor s"itc#es bet"een

    dierent t#reads T#is conte,t s"itc#ing generally #appens re2uently enoug#t#at t#e user perceives t#e t#reads or tas's as running at t#e same time

    %n a multiprocessor or multi0core system4 t#reads can be truly concurrent4"it# every processor or core e,ecuting a separate t#read simultaneously

  • 8/15/2019 Process Management in Solaris

    5/22

  • 8/15/2019 Process Management in Solaris

    6/22

    Advantages o T#reads in Solaris

    T#e main beneit o t#reads 5as compared to multiple processes6 is t#at t#econte,t s"itc#es are muc# c#eaper t#an t#ose re2uired to c#ange current

    processes

    /ven "it#in a single0processor environment4 multiple t#reads are

    advantageous because one t#read may be able to progress even t#oug#anot#er t#read is bloc'ed "#ile "aiting or a resource

    T#reads also #ave private resources 5program counter4 stac'4 register conte,t4etc6

  • 8/15/2019 Process Management in Solaris

    7/22

    ig#t"eig#t Processes

    A lig#t"eig#t process can be considered as t#e s"appable portion o a 'ernelt#read A lig#t0"eig#t process 5P6 is a means o ac#ieving multitas'ing

    A P runs in user space on top o a single 'ernel t#read and s#ares itsaddress space and system resources "it# ot#er Ps "it#in t#e same process

  • 8/15/2019 Process Management in Solaris

    8/22

    ombie Processes

     #en a process dies4 it becomes a :ombie process A :ombie process ordeunct process is a process t#at #as completed e,ecution but still #as an

    entry in t#e process table

    .ormally4 t#e parent perorms a "ait56 and cleans up t#e PID

    3illing t#e parent or rebooting "ill also clean up :ombies

    T#e correct ans"er is to i, t#e buggy parent code t#at ailed to perorm t#e"ait56 properly

  • 8/15/2019 Process Management in Solaris

    9/22

    Managing System Processes

    ps0 c#ec's status o all active processes T#e ollo"ing inormation is reported "#en tcommand is e,ecuted

    !urrent status o t#e process

    Process ID

    Parent process ID

    +ser ID

    Sc#eduling class

    Priority

    Address o t#e process

    Memory used

  • 8/15/2019 Process Management in Solaris

    10/22

    pldd0 ists t#e dynamic libraries t#at are lin'ed into a process

    pmap0 Prints t#e address space map o eac# process

    pstop0 stops t#e process

    p"d,0 Displays t#e current "or'ing directory or a process

    ptree0 Displays t#e process trees t#at contain t#e process

    p'ill0 To 'ill a process in case it gets stuc' in an ininite loop

  • 8/15/2019 Process Management in Solaris

    11/22

    Process Scheduling0Priority Model

    T#e Solaris 'ernel is ully preemptible T#is means t#at all t#reads4

    including t#e t#reads t#at support t#e 'ernel;s o"n activities4 can be

    deerred to allo" a #ig#er0 priority t#read to run

     Solaris recogni:es 17) dierent priorities4 )01

  • 8/15/2019 Process Management in Solaris

    12/22

    Sc#eduling classes in Solaris

    TS (timeshare): T#is is t#e deault class or processes and t#eirassociated 'ernel t#reads Priorities "it#in t#is class range )0>94 and

    are dynamically adusted in an attempt to allocate processor

    resources evenly

    IA (interactive): T#is is an en#anced version o t#e TS class t#atapplies to t#e in0ocus "indo" in t#e -+I Its intent is to give e,tra

    resources to processes associated "it# t#at speciic "indo" i'e TS4IA;s range is )0>9

  • 8/15/2019 Process Management in Solaris

    13/22

    FSS (fair-share scheduler): T#is class is s#are0based rat#er t#anpriority0 based T#reads managed by ?SS are sc#eduled based on t#eir

    associated s#ares and t#e processor;s utili:ation ?SS also #as a range

    )0>9

    FX (fixed-priorit): T#e priorities or t#reads associated "it# t#isclass are i,ed 5In ot#er "ords4 t#ey do not vary dynamically over t#e

    lietime o t#e t#read6 ?@ also #as a range )0>9

  • 8/15/2019 Process Management in Solaris

    14/22

    S!S (sstem): T#e SS class is used to sc#edule 'ernel t#readsT#reads in t#is class are BboundB t#reads4 "#ic# means t#at t#ey run

    until t#ey bloc' or complete Priorities or SS t#reads are in t#e 94 so an $T t#read "ill

    preempt a system t#read $eal time processes cannot be preemptedby any ot#er process4 t#ereore it usually re2uires administrative

    privileges to run It is normally not advisable to create a $T process

  • 8/15/2019 Process Management in Solaris

    15/22

    Implementation o Time Slicing or TS

    and IA

    TS and IA sc#eduling classes implement an adaptive time slicing

    sc#eme t#at increases t#e priority o I=%0bound processes at t#e

    e,pense o compute0bound processes T#e e,act values t#at are used

    to implement t#is can be ound in t#e dispatc# table

    To e,amine t#e TS dispatc# table4 run t#e command

    dispadmin 0c TS 0g

  • 8/15/2019 Process Management in Solaris

    16/22

    T#e ollo"ing values are reported in t#e dispatc# table*

    ts#$uantum* T#is is t#e deault lengt# o time assigned to a process "it# t#especiied priority

    ts#t$exp* T#is is t#e ne" priority t#at is assigned to a process t#at uses itsentire time 2uantum

    ts#slpret* T#e ne" priority assigned to a process t#at bloc's beore using its

    entire time 2uantum

    ts#max%ait* I a t#read does not receive !P+ time during a time interval otsCma,"ait4 its priority is raised to tsCl"ait

  • 8/15/2019 Process Management in Solaris

    17/22

    Modiying t#e dispatc# table

    dispadmin can be used to edit t#e dispatc# table to aect t#e decay opriority or compute0bound processes or t#e gro"t# in priority or I=%0bound

    processes

     In particular4 tsCma,"ait and tsCl"ait can prevent !P+ starvation4 and

    raising tsCt2e,p slig#tly can slo" t#e decline in priority o !P+0boundprocesses

    In any case4 t#e dispatc# tables s#ould only be altered slig#tly at eac# step int#e tuning process4 and s#ould only be altered at all i you #ave a speciic

    goal in mind

  • 8/15/2019 Process Management in Solaris

    18/22

  • 8/15/2019 Process Management in Solaris

    19/22

    Time Slicing or ?SS

    In ?SS4 t#e time 2uantum is t#e lengt# o time t#at a t#read is allo"ed to runbeore it #as to release t#e processor T#is can be c#ec'ed using

    dispadmin 0c ?SS 0g

     T#e +A.T+M is reported in ms 5T#e output o t#e above command displayst#e resolution in t#e $/S parameter T#e deault is 1))) slices per second6 It

    can be adusted using dispadmin as "ell

  • 8/15/2019 Process Management in Solaris

    20/22

    T#undering Eerd

    #en a resource is reed4 all t#reads a"aiting t#at resource are

    "o'en T#is results in a ootrace to obtain access to t#at obectF one

    succeeds and t#e ot#ers return to sleep5bloc'ed state6 T#is can lead

    to "asted over#ead or conte,t s"itc#es T#is is called a Bt#undering

    #erdB problem

  • 8/15/2019 Process Management in Solaris

    21/22

    Issues "it# $eal Time processes

    $eal time processes also loc' all t#eir pages in memory T#is can causeproblems on a system t#at is underconigured or t#e amount o memory t#at

    is re2uired

     Since real time processes run at suc# a #ig# priority4 system daemons maysuer i t#e real time process does not permit t#em to run

     #en a real time process or's4 t#e ne" process also in#erits real time

    privileges T#e programmer must ta'e care to prevent unintendedconse2uences oops can also be #ard to stop4 so t#e programmer also needs

    to ma'e sure t#at t#e program does not get caug#t in an ininite loop

  • 8/15/2019 Process Management in Solaris

    22/22

    $eerences

    """docsoraclecom

    """princtonedu

    http://www.docs.oracle.com/http://www.princton.edu/http://www.princton.edu/http://www.docs.oracle.com/

Recommended