Project

General

Profile

Actions

Feature #15004

closed

diskinfo: get rid of topo calls if there are no -c or -P options

Added by Andy Fiddaman 5 days ago. Updated 3 days ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

There's a commit from Tintri by DDN in OmniOS which avoids calls into topo when those data are not required.

https://github.com/omniosorg/illumos-omnios/commit/0307587db7989cb2ee157c6e2aeccb79e7bdb553

This speeds it up a little and makes the command work in the absence of topo when
run without options.

Server with 18 disks:

$ time diskinfo
TYPE DISK VID PID SIZE RMV SSD
SCSI c0t5000CCA04D086780d0 HGST HUSMR1625ASS 232.89 GiB no yes
....

real 0m3.952s
user 0m0.205s
sys 0m0.436s
$ time ./diskinfo.new
TYPE DISK VID PID SIZE RMV SSD
SCSI c0t5000CCA04D086780d0 HGST HUSMR1625ASS 232.89 GiB no yes
...

real 0m0.107s
user 0m0.016s
sys 0m0.032s

Actions #1

Updated by Andy Fiddaman 5 days ago

  • Status changed from In Progress to Closed
Actions #2

Updated by Andy Fiddaman 5 days ago

  • Status changed from Closed to In Progress
Actions #3

Updated by Electric Monk 5 days ago

  • Gerrit CR set to 2381
Actions #4

Updated by Andy Fiddaman 4 days ago

I tested this on a number of servers, comparing the output of a plain diskinfo before and after this change, and then with the -p, -c and -P parameters. Output was unchanged in all cases. With no parameters, the new version was consistently faster.

Actions #5

Updated by Electric Monk 3 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 2b766db42fbe7dc313c8d6de18e15f3aa15a35bb

commit  2b766db42fbe7dc313c8d6de18e15f3aa15a35bb
Author: Alexander Eremin <aeremin@tintri.com>
Date:   2022-09-24T08:56:25.000Z

    15004 diskinfo: get rid of topo calls if there are no -c or -P options
    Reviewed by: Marco van Wieringen <mvw@planets.elm.net>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF