Does swapped-out LWP have 't_schedflag==0'?

In last post, I use p_swapcnt info in proc_t to find out process(es) with lwp(s)/thread(s) swapped-out.

I also tried to walk through threads list and check their flags/states, however I'm not quite sure which one corresponds to the swapped-out state.

I do find that if I check on t_schedflag, when it's '0', the pids are the same as what I get from last post

-----------------------

echo "::walk thread|::print -t kthread_t t_tid t_schedflag t_procp->p_pidp->pid_id"|mdb -k > /tmp/walk_thread.out

-----------------------

I then use a awk script to print out those threads whose t_schedflag is 0

--------------------------


root@cdlabx4200-1[5.10]:/# awk '{if(NR%3){printf("%s\t",$0);}else{printf("%s\n",$0);}}' /tmp/walk_thread.out |awk '{if($8==0){printf("pid=%s\ttid=%4s\tt_schedflag=%s\n",$NF,$4,$8);}}'
pid=0x102 tid= 0x2 t_schedflag=0
pid=0x7d1 tid= 0x2 t_schedflag=0
pid=0x7d1 tid= 0x3 t_schedflag=0
pid=0x7d1 tid= 0x4 t_schedflag=0
pid=0x7d1 tid= 0x5 t_schedflag=0
pid=0x7d1 tid= 0x6 t_schedflag=0
pid=0x7d1 tid= 0x7 t_schedflag=0
pid=0x7d1 tid= 0xa t_schedflag=0
pid=0x7d1 tid= 0xc t_schedflag=0
pid=0x7d1 tid= 0xe t_schedflag=0
pid=0x7d1 tid= 0xf t_schedflag=0
pid=0x7d1 tid=0x10 t_schedflag=0
pid=0x7d1 tid=0x11 t_schedflag=0
pid=0x7d1 tid=0x12 t_schedflag=0
pid=0x7d1 tid=0x13 t_schedflag=0
pid=0x7d1 tid=0x14 t_schedflag=0
pid=0x601d tid= 0x1 t_schedflag=0
root@cdlabx4200-1[5.10]:/#


--------------------------------


See pids are the same as in last post.


I guess when a thread is swapped out, its t_schedflag is cleared because it makes no sense any more.


-EOF-



评论:

发表一条评论:
  • HTML语法: 禁用
About

samwan

Search

Categories
Archives
« 四月 2014
星期日星期一星期二星期三星期四星期五星期六
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
今天