Skip to content

Conversation

@Harshil2107
Copy link
Contributor

This PR adds source to create disk image on the lmbench benchmark.

The lmbench benchmark is highly customizable so this change updates the make file of lmbench to allow predefined config files (no original functionality is removed). This change also has a basic config to run lmbench on the os of the disk available.

To run this disk in gem5 (x86 for now) you can use the following json:

[
    {
        "category": "workload",
        "function": "set_kernel_disk_workload",
        "resources": {
            "kernel": {
                "id": "x86-linux-kernel-6.8.0-52-generic",
                "resource_version": "1.0.0"
            },
            "disk_image": {
                "id": "x86-ubuntu-24.04-lmbench-img",
                "resource_version": "1.0.0"
            }
        },
        "additional_params": {
            "kernel_args": [
                "earlyprintk=ttyS0",
                "console=ttyS0",
                "lpj=7999923",
                "root=/dev/sda2"
            ],
            "readfile_contents": "cd /home/gem5/lmbench/src; echo 12345 | sudo -S make results-with-config CONFIGFILE=/home/gem5/configs/CONFIG_OS.gem5; sleep 5;"
        },
        "architecture": "X86",
        "size": 0,
        "tags": [
            "lmbench",
            "24.04",
            "fullsystem"
        ],
        "code_examples": [],
        "license": "",
        "author": [
            "Harshil Patel"
        ],
        "source_url": "",
        "resource_version": "1.0.0",
        "gem5_versions": [
            "25.0"
        ],
        "id": "x86-ubuntu-lmbench-os",
        "description": "A workload that runs the OS lmbench benchmark.",
        "example_usage": "obtain_resource(\"x86-ubuntu-lmbench-os\", resource_version=\"1.0.0\")"
    },

    {
        "id": "x86-ubuntu-24.04-lmbench-img",
        "resource_version": "1.0.0",
        "category": "disk-image",
        "author": [
            "Harshil Patel"
        ],
        "code_examples": [],
        "description": "A disk image containing the lmbench benchmarks for Ubuntu 24.04 for x86. This image will run an `m5 readfile` instruction after booting. This diskimage will run m5 exit events at different intevals in the boot process, please refer to the README.md of the source for more information.",
        "source_url": "",
        "license": "",
        "tags": [
            "x86",
            "fullsystem"
        ],
        "example_usage": "obtain_resource(resource_id=\"x86-ubuntu-24.04-lmbench-img\")",
        "gem5_versions": [
            "25.0"
        ],
        "size": 5242880000,
        "url": "file:///home/harshilp/forks/gem5-resources-repo/src/lmbench-24.04.imgs/disk-image-x86-lmbench/x86-ubuntu-lmbench-24.04",
        "is_tar_archive": false,
        "md5sum": "3de65077bab8ea6978d17c205c4e2b8e",
        "is_zipped": false,
        "architecture": "X86",
        "root_partition": "1",
        "source": "src/x86-ubuntu"
    }
]

Then you can call the workload x86-ubuntu-lmbench-os in you config and run the config as follows:

GEM5_RESOURCE_JSON_APPEND=./lmbench-workload.json ./build/ALL/gem5.opt lmbench-run.py

@Harshil2107 Harshil2107 marked this pull request as draft November 14, 2025 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant