Skip to content

Commit

Permalink
Tools directory changes: (#31)
Browse files Browse the repository at this point in the history
* Tools directory changes:
- Add readme.md demonstrating expected tool script usage for namespace manipulation
- Add examples to nvme.sh
- Extend create-write-delete.sh to format the namespace before deleting the namespace to see if delete_ns speeds up.

Signed-off-by: Anthony Floeder <[email protected]>

Add readme.md that demonstrates usage

Signed-off-by: Anthony Floeder <[email protected]>

* Use long names to avoid confusion

Signed-off-by: Anthony Floeder <[email protected]>

Signed-off-by: Anthony Floeder <[email protected]>
  • Loading branch information
ajfloeder authored Oct 6, 2022
1 parent 1080197 commit b7f6cc6
Show file tree
Hide file tree
Showing 4 changed files with 405 additions and 4 deletions.
13 changes: 12 additions & 1 deletion tools/create-write-delete-namespaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ case "$SIZE" in
./lvm.sh create

# Write a little something to the logical volume to give the drives some work to do on delete-ns operation
fio --direct=1 --rw=randwrite --bs=32M --ioengine=libaio --iodepth=128 --numjobs=4 --runtime=30s --time_based --group_reporting --name=rabbit --eta-newline=1 --filename=/dev/rabbit/rabbit
fio --direct=1 --rw=randwrite --bs=32M --ioengine=libaio --iodepth=128 --numjobs=4 --runtime=5m --time_based --group_reporting --name=rabbit --eta-newline=1 --filename=/dev/rabbit/rabbit

if [ $DELAY_TO_COOL_CPU != 0 ]
then
Expand All @@ -57,6 +57,17 @@ case "$SIZE" in
# Delete the logical volume to tidy up
./lvm.sh delete

# Format the namespace to speed up deletion
./nvme.sh cmd format --force --namspace-id=1

# Wait for the format to finish
areWeDone=$(nvme list | grep KIO | awk '{if ($6 > 0) { print "wait" } else { print "done" }}')
while [ "$areWeDone" != "done" ]; do
sleep 1
printf "Formatting, space left %f\n" "$(nvme list | grep KIO | awk '{print $6}')"
areWeDone=$(nvme list | grep KIO | awk '{if ($6 > 0) { print "wait" } else { print "done" }}')
done

# Show the nvme namespaces for the record
nvme list | grep KIO

Expand Down
2 changes: 1 addition & 1 deletion tools/lvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ drives() {
if [ "${NAMESPACEID::-1}" == "$NAMESPACE" ];
then
echo " Found Namespace ${NAMESPACE}"

DRIVES+=(${DRIVE})
fi
fi
Expand Down
9 changes: 7 additions & 2 deletions tools/nvme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ Arguments:
-h display this help
-t time each command
Example:
nvme.sh -t delete 1
Examples:
./nvme.sh -t delete 1
./nvme.sh cmd id-ctrl | grep -E "^fr " # firmware level
./nvme.sh cmd id-ctrl | grep -E "^mn " # model name
./nvme.sh cmd format --force --ses=0 --namespace-id=<namespace id> # format specified namespace
./nvme.sh cmd virt-mgmt --cntlid=3 --act=9 # enable CM7 virtual functions
EOF
}

Expand Down
Loading

0 comments on commit b7f6cc6

Please sign in to comment.