Project

General

Profile

Bug #11260

mdb zfs metaslab statistics are unavailable

Added by Kody Kantor 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
mdb - modular debugger
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

I tried to look at per-vdev metaslab data using mdb today, and this is what I saw:

> ::walk spa | ::spa_vdevs -m
            ADDR             STATE     AUX          DESCRIPTION
            fffffe038b589800 HEALTHY   -            root
            fffffe039d3a7000 HEALTHY   -              /dev/dsk/c2t1d0s0
                ADDR                 ID               OFFSET       FREE FRAGMENTATION
mdb: could not find member sm_alloc of type space_map_t
                fffffe0387359800 HEALTHY   -            root
                fffffe038735d000 HEALTHY   -              /dev/dsk/c2t0d0s0
                    ADDR                 ID               OFFSET       FREE FRAGMENTATION
mdb: could not find member sm_alloc of type space_map_t

It looks like one of our recent ports from ZoL removes the sm_alloc member from the space_map_t struct. sm_alloc was a cached representation of allocated space for the metaslab. I believe we have to change the mdb module to use the space_map_phys_t's smp_alloc field instead.

zdb is not affected by this bug.

History

#1

Updated by Kody Kantor 4 months ago

Testing notes:

I did some basic manual verification after this change has been applied (ZFS mdb functionality isn't currently tested by the zfs-test framework).

On SmartOS:

[root@dew ~]# mdb -ke '::walk spa | ::spa_vdevs -mh' | head
ADDR             STATE     AUX          DESCRIPTION
fffffe0bd7d25000 HEALTHY   -            root
fffffe0bd7d4c800 HEALTHY   -              /dev/dsk/c2t5d0s0
    ADDR                 ID               OFFSET       FREE FRAGMENTATION
    fffffe0bd7db8800      0                    0      5.01M        63%
      9:      1 *
     10:      1 *
     11:      4 ****
     12:     11 ***********
     13:     12 ************
mdb: write to stdout failed, exiting

On OpenIndiana:

$ sudo mdb -ke '::spa -Mh' | tail -n 100
ADDR                 STATE NAME
ffffff06ea8ec000    ACTIVE rpool
      9: 124617 *****************
     10: 217451 ******************************
     11: 294953 ****************************************
     12: 164190 ***********************
     13: 144624 ********************
     14: 122686 *****************
     15: 100412 **************
     16:  70952 **********
     17:  93005 *************
     18:  44459 *******
     19:  16241 ***
     20:   6534 *
     21:   3192 *
     22:   1742 *
     23:    984 *
     24:    476 *
     25:    228 *
     26:    274 *
     27:     31 *
     28:      5 *
     29:      4 *

    ADDR             STATE     AUX          DESCRIPTION
    ffffff06eab7a000 HEALTHY   -            root
    ffffff06ead8c800 HEALTHY   -              /dev/dsk/c3t0d0s1
        ADDR               FRAGMENTATION
        ffffff06ead86d00              20%
          9: 124617 *****************
         10: 217451 ******************************
         11: 294953 ****************************************
         12: 164190 ***********************
         13: 144624 ********************
         14: 122686 *****************
         15: 100412 **************
         16:  70952 **********
         17:  93005 *************
         18:  44459 *******
         19:  16241 ***
         20:   6534 *
         21:   3192 *
         22:   1742 *
         23:    984 *
         24:    476 *
         25:    228 *
         26:    274 *
         27:     31 *
         28:      5 *
         29:      4 *

$ sudo mdb -ke '::spa -mh' | head -30
ADDR                 STATE NAME
ffffff06ea8ec000    ACTIVE rpool
      9: 124626 *****************
     10: 217460 ******************************
     11: 294946 ****************************************
     12: 164189 ***********************
     13: 144629 ********************
     14: 122684 *****************
     15: 100418 **************
     16:  70946 **********
     17:  93009 *************
     18:  44458 *******
     19:  16241 ***
     20:   6535 *
     21:   3192 *
     22:   1742 *
     23:    984 *
     24:    476 *
     25:    228 *
     26:    274 *
     27:     31 *
     28:      5 *
     29:      4 *

    ADDR             STATE     AUX          DESCRIPTION
    ffffff06eab7a000 HEALTHY   -            root
    ffffff06ead8c800 HEALTHY   -              /dev/dsk/c3t0d0s1
        ADDR                 ID               OFFSET       FREE FRAGMENTATION
        ffffff06e7427800      0                    0       703M        19%
          9:    515 *******************************   
mdb: write to stdout failed, exiting
#2

Updated by Electric Monk 4 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 29d33d4278d4226572dfc214775224334bc444a6

commit  29d33d4278d4226572dfc214775224334bc444a6
Author: Kody A Kantor <kody@kkantor.com>
Date:   2019-06-21T18:59:57.000Z

    11260 mdb zfs metaslab statistics are unavailable
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF