5 messages in org.opensolaris.mdb-discuss[mdb-discuss] ::kmastat output differ...
FromSent OnAttachments
Raymond LIAug 2, 2007 5:29 am 
Jonathan AdamsAug 3, 2007 5:53 am 
Raymond LIAug 3, 2007 7:07 am 
Oliver YangAug 9, 2007 7:53 am 
Jonathan AdamsAug 9, 2007 12:56 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[mdb-discuss] ::kmastat output different in meaning between x86 32-bit and 64-bit?Actions...
From:Raymond LI (Raym@Sun.COM)
Date:Aug 2, 2007 5:29:21 am
List:org.opensolaris.mdb-discuss

Guys,

I met a puzzle when I work with my amd64 box. When I observe a stream slab of 2048 sizes, the "buf in use", "buf total" and "memory in use" seems to mean different thing between 32/64 bit kernels.

I allocated mbuf of 1600 bytes, In 64-bit mode, the cache name of 2048 should have name of "streams_dblk_1936", output like below: cache buf buf buf memory alloc alloc name size in use total in use succeed fail ------------------------- ------ ------ ------ --------- --------- ----- streams_dblk_1936 2048 602 602 2465792 1382 0

While with 32-bit mode, with the name of "streams_dblk_1984", output like below: cache buf buf buf memory alloc alloc name size in use total in use succeed fail ------------------------- ------ ------ ------ --------- --------- ----- streams_dblk_1984 2048 600 603 1372160 608 0

My first question is: why in 64-bit kernel, the "memory in use" = ("buf in use" + "buf total") * "buf size"? And we see in 32-bit kernel, it is "buf total" * "buf size".

Another thing I don't understand is my driver allocated 600 mblk of 1600 Bytes during attach. After rem_drv, I found in 64-bit kernel, kmastat reports below:

cache buf buf buf memory alloc alloc name size in use total in use succeed fail ------------------------- ------ ------ ------ --------- --------- ----- streams_dblk_1936 2048 2 2 8192 1493 0

"buf total" also reduced by 600 after freemsg. And it seems next time allocate, stream module will allocate new area of streams_dblk_1936.

While on 32-bit kernel, the streams_dblk_1984 seems to be still there:

cache buf buf buf memory alloc alloc name size in use total in use succeed fail ------------------------- ------ ------ ------ --------- --------- ----- streams_dblk_1984 2048 0 603 1372160 608 0

Why "buf total" still 603?

Thanks,

Raymond