Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-17-2008, 06:04 AM
Alex Vinokur
 
Posts: n/a
Default Getting shm segment id via 'ipcs -m' and struct pst_shminfo

> uname -smrsv
HP-UX B.11.23 U ia64

I displayed similar information of shared memory segments via 'ipcs -
m' and struct pst_shminfo

> ipcs -mb

IPC status from /dev/kmem as of Thu Mar 13 07:49:12 2008
T ID KEY MODE OWNER GROUP SEGSZ
Shared Memory:
m 0 0x411c11f2 --rw-rw-rw- root root 348
m 1 0x4e0c0002 --rw-rw-rw- root root 61760
m 2 0x4128002f --rw-rw-rw- root root 8192
m 3 0x00a5c581 --rw------- user0 users 10469376
m 360452 0x0c6629c9 --rw-r----- root root 21968472
m 5 0x06347849 --rw-rw-rw- root root 65544
m 65542 0x491421e2 --rw-r--r-- root root 22908
m 1474567 0x41bd82ec --rw-r----- oracle dba 4211093504
m 24477704 0x00000000 D-rw------- -1 -1 46084
m 9 0x01300072 --rw-rw-rw- root root 1024
m 10 0x01300090 --rw-rw-rw- root root 1078
m 11 0x0130009f --rw-rw-rw- root root 1070
m 12 0x013000a3 --rw-rw-rw- root root 1034
m 13 0x013000aa --rw-rw-rw- root root 1036
m 14 0x013000a9 --rw-rw-rw- root root 1042
m 326139919 0x0072e930 --rw-rw---- user1 pm 4294967296
m 27394064 0x00000000 D-rw-rw---- user2 cc 4294967296
m 339607569 0x006cc104 --rw-rw---- user3 pm 4294967296
m 21430292 0x00006c98 --rw-rw---- user2 cc 4294967296



---> via struct pst_shminfo
First column in this table is pst_idx.

id owner key size cur # of
procs attached cur # attached
0 0 0x411c11f2
348 0 0
1 0 0x4e0c0002
61760 1 0
2 0 0x4128002f
8192 1 0
3 102 0xa5c581
10469376 1 0
4 0 0xc6629c9
21968472 2 2
5 0 0x6347849
65544 2 0
6 0 0x491421e2
22908 0 1
7 269 0x41bd82ec
4211093504 19 19
8 -1 0
46084 3 1
9 0 0x1300072
1024 2 0
10 0 0x1300090
1078 2 0
11 0 0x130009f
1070 2 0
12 0 0x13000a3
1034 2 0
13 0 0x13000aa
1036 2 0
14 0 0x13000a9
1042 2 0
15 75308 0x72e930
4294967296 0 2
16 278 0
4294967296 1 2
17 71273 0x6cc104
4294967296 0 2
20 278 0x6c98
4294967296 1 2


We can see that shm segment id
* via 'ipcs -m'
and
* via struct pst_shminfo
is not always the same value.

What is a reason for that difference?
Can we get the shm id (as in 'ipcs -m') via struct pst_shminfo?

-------------------
Another question.
What is the difference between pst_nattch and pst_cnattch in struct
pst_shminfo?

Thanks.


Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-17-2008, 06:04 AM
Alex Vinokur
 
Posts: n/a
Default Re: Getting shm segment id via 'ipcs -m' and struct pst_shminfo

On Mar 13, 8:33*am, Alex Vinokur <ale...@users.sourceforge.net> wrote:

[snipped]

Sorry, here is almost the same table printed more friendly.

>
> ---> via struct pst_shminfo
> First column in this table is pst_idx.
>

[snipped]

id owner key size
0 0 0x411c11f2 348
1 0 0x4e0c0002 61760
2 0 0x4128002f 8192
3 102 0xa5c581 10469376
4 0 0xc6629c9 21968472
5 0 0x6347849 65544
6 0 0x491421e2 22908
7 269 0x41bd82ec 4211093504
8 -1 0 46084
9 0 0x1300072 1024
10 0 0x1300090 1078
11 0 0x130009f 1070
12 0 0x13000a3 1034
13 0 0x13000aa 1036
14 0 0x13000a9 1042
15 75308 0x72e930 4294967296
16 278 0 4294967296
17 71273 0x6cc104 4294967296
20 278 0x6c98 4294967296

[snipped]

Alex Vinokur
* * *email: alex DOT vinokur AT gmail DOT com
* * *http://mathforum.org/library/view/10978.html
* * *http://sourceforge.net/users/alexvn

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-17-2008, 06:04 AM
Dennis Handly
 
Posts: n/a
Default Re: Getting shm segment id via 'ipcs -m' and struct pst_shminfo

Alex Vinokur wrote:
> We can see that shm segment id
> * via 'ipcs -m'
> * via struct pst_shminfo
> is not always the same value.
> What is a reason for that difference?
> Another question.
> What is the difference between pst_nattch and pst_cnattch in struct
> pst_shminfo?


You might be able to see this in my example program in:
http://forums.itrc.hp.com/service/fo...readId=1136341
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-17-2008, 06:04 AM
Don Morris
 
Posts: n/a
Default Re: Getting shm segment id via 'ipcs -m' and struct pst_shminfo

Dennis Handly wrote:
> Alex Vinokur wrote:
>> We can see that shm segment id
>> * via 'ipcs -m'
>> * via struct pst_shminfo
>> is not always the same value.
>> What is a reason for that difference?


Yes, as Dennis's program shows - index and shmid are not
the same thing. ipcs shows shimd, you were printing index.
If you want to match, print the psh_shmid field.

>> Another question.
>> What is the difference between pst_nattch and pst_cnattch in struct
>> pst_shminfo?


psh_nattch vs. psh_cnattach, I think you mean.

The difference is pretty simple -- nattch should be accurate,
cnattach may not be and really shouldn't be used. (Both are there
to provide backwards compatibility when the segment handling changed
to keep nattch more accurate).

There's a comment describing each field in sys/pstat/ipc_pstat_body.h
that you might find useful... or look at the pstat whitepaper:
http://docs.hp.com/en/1216/pstat_whitepaper.pdf

Don

>
> You might be able to see this in my example program in:
> http://forums.itrc.hp.com/service/fo...readId=1136341

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-17-2008, 06:04 AM
Alex Vinokur
 
Posts: n/a
Default Re: Getting shm segment id via 'ipcs -m' and struct pst_shminfo

On Mar 13, 2:24*pm, Don Morris <dgmor...@earthlink.net> wrote:
> Dennis Handly wrote:
> > Alex Vinokur wrote:

[snipped]
> If you want to match, print the psh_shmid field.

See below.

[snipped]
> psh_nattch vs. psh_cnattach, I think you mean.

Of course, my mistake.
>
> There's a comment describing each field in sys/pstat/ipc_pstat_body.h
> that you might find useful... or look at the pstat whitepaper:http://docs.hp.com/en/1216/pstat_whitepaper.pdf


psh_shmid is missing in that whitepaper, but it is actually is in
file /ipc_pstat_body.h.

Now I am using psh_shmid and it works fine.

Don, thank you very much.

Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62