Closed MingzheL1u closed 4 years ago
Hi,
By default, SimpleSSD only calculates timing (latency) of I/O and does not store any data written to the SSD. To create filesystem, you need to change configuration file to make SimpleSSD to store data to backing file.
I don't recommend you to run fdisk
and mkfs
inside of gem5 simulation (VERY, VERY SLOW). Please check following steps:
[nvme]
LBASize = 512 # You MUST set LBA size as 512, not 4096.
EnableDiskImage = 1 # Change this to one.
StrictSizeCheck = 0 # Let this zero, if your disk image has different size with simulated SSD.
DiskImageFile1 = <path to your disk image. This path is relative to your working directory, not M5_PATH.>
UseCopyOnWriteDisk = 1 # Change this to one.
P.S. 1. If you set [nvme] UseCopyOnWriteDisk
as zero, data written during simulation will be stored to backing file -- which makes filesystem corruption when running multiple simulation with same disk image.
P.S. 2. If disk image is not exists on the path, SimpleSSD will create zero-filled disk image file.
If your problem solved, please close the issue.
Thanks.
Thanks for your reply.
I created a disk image to store data, and modified the configuration file of the SimpleSSD following your tips. Particularly, I configured the DiskImageFile1 with "nvme.img", and put nvme.img in the same directory of sample.config. Then I run simulation with the command as before with nothing change.
I am not clear about whether I should use absolute or relative paths of "DiskImageFile1". But it doesn't matter, because SimpleSSD will create a disk image file if my disk image is not exists.
So where is the disk image after I boot the system? Where should I go to find it?
root@genericarmv8:~# cat /proc/partitions
major minor #blocks name
259 0 402653184 nvme0n1
8 0 1048576 sda
8 1 1047552 sda1
root@genericarmv8:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 990.9M 233.5M 690.2M 25% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 16.0K 1.9G 0% /run
tmpfs 1.9G 36.0K 1.9G 0% /var/volatile
root@genericarmv8:~# fdisk -l
Disk /dev/nvme0n1: 412.3 GB, 412316860416 bytes
64 heads, 32 sectors/track, 393216 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/nvme0n1 doesn't contain a valid partition table
Disk /dev/sda: 1073 MB, 1073741824 bytes
139 heads, 8 sectors/track, 1885 cylinders
Units = cylinders of 1112 * 512 = 569344 bytes
Device Boot Start End Blocks Id System
/dev/sda1 2 1886 1047552 83 Linux
Thanks!
Hi,
SimpleSSD should create empty disk image file when file does not exists, but this file is zero-filled so there is no partition table and no filesystem.
Please put the nvme.img
at the working directory where you run the simulation if you set [nvme] DiskImageFile1 = nvme.img
.
(I assume you created partition table and file system on nvme.img)
cd <your simplessd-fullsystem directory>
mv <your nvme.img> .
./build/ARM/gem5.opt --debug-flag=M5Print --debug-file=debug.txt ./configs/example/fs.py \
--kernel=aarch64-vmlinux-4.9.92 --dtb-file=armv8_gem5_v1_4cpu.dtb --machine-type=VExpress_GEM5_V1 \
--num-cpu=4 --cpu-clock=2GHz --caches --l2cache --cpu-type=AtomicSimpleCPU --mem-size=4GB \
--mem-type=DDR4_2400_8x8 --ssd-interface=nvme --ssd-config=./src/dev/storage/simplessd/config/sample.cfg \
--disk-image=linaro-aarch64-linux.img
And check that stdout
of gem5
contains following message as coded here:
0: ICL::GenericCache: CREATE | line count in super page 8 | line count in max I/O 64
0: info: Using disk image at nvme.img for NSID 1
0: HIL::NVMe: NS 1 | CREATE | LBA size 512 | Capacity 805306368
If Linux Kernel detects your disk image correctly, you can find relevant kernel log in m5term
:
[ 0.381836] nvme nvme0: pci function 0000:00:02.0
[ 0.381847] nvme 0000:00:02.0: enabling device (0000 -> 0002)
[ 0.381855] nvme 0000:00:02.0: enabling bus mastering
...
[ 0.383017] nvme0n1: p1
And can be mounted by following command (I used linaro-aarch64-linux.img
as nvme.img
):
root@genericarmv8:~# cat /proc/partitions
major minor #blocks name
259 0 402653184 nvme0n1
259 1 1047552 nvme0n1p1
8 0 1048576 sda
8 1 1047552 sda1
root@genericarmv8:~# mkdir mnt
root@genericarmv8:~# mount /dev/nvme0n1p1 mnt/
[ 1.333278] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Opts: (null)
root@genericarmv8:~# ls mnt
bin data etc lib media opt run sys usr
boot dev home lost+found mnt proc sbin tmp var
root@genericarmv8:~#
You can even boot Linux from SimpleSSD by using linaro-aarch64-linux.img
as DiskImageFile1
and add --disable-ide --root-device=/dev/nvme0n1p1
option when running gem5
.
Thanks.
Thanks for your reply and your answer.
I booted the system and find the nvme disk successfully follow your guide. And I also boot Linux by using linaro-aarch64-linux.img
.
It's very kind of you. Thank you very much.
Running Environment:
Execution information
./build/ARM/gem5.opt --debug-flag=M5Print --debug-file=debug.txt ./configs/example/fs.py --kernel=aarch64-vmlinux-4.9.92 --dtb-file=armv8_gem5_v1_4cpu.dtb --machine-type=VExpress_GEM5_V1 --num-cpu=4 --cpu-clock=2GHz --caches --l2cache --cpu-type=AtomicSimpleCPU --mem-size=4GB --mem-type=DDR4_2400_8x8 --ssd-interface=nvme --ssd-config=./src/dev/storage/simplessd/config/sample.cfg --disk-image=linaro-aarch64-linux.img
Explain what you want to ask here:
I want to run SimpleSSD-FullSystem with the default settings. So I follow the website you provided: https://docs.simplessd.org/en/v2.0.12/index.html. To avoid anything unexpected, I did not change anything in the source code, and I downloaded the kernel image and disk image in the website: https://drive.google.com/drive/folders/14b-kJmGXOhltX9Aqr8XV9i48KkZk4Lzs?usp=sharing. I use the command above to boot the SimpleSSD-FS. After booting the system successfully, I use "cat /proc/partitions" to show the partitions, and the result is:
And I use "fdisk /dev/nvme0n1" to create a new partition. When I want to write the settings and exit from the menu of fdisk. Errors happened. The stdout of the GEM5 is:
And the stdout of SimpleSSD is:
It seems that everything goes well at the beginning of the SimpleSSD-FS, and the log shows that admin and I/O queues are successfully create. The stdout of GEM5 is:
So could you help me find out what the problem is? Looking forward to your reply.