Skip to content

Conversation

@wnsah814
Copy link
Contributor

Description

Problem

The existing FEMU ZNS SSD implementation had incomplete zone reset functionality, causing the following issues:

  • Zone reset commands did not calculate proper latency
  • Internal state cleanup was missing during zone reset, potentially causing data consistency issues

Solution

Implemented complete zone reset operation:

  1. Immediate Processing:

    • Invalidate write buffer for the target zone
    • Clear logical-to-physical address mappings
    • Invalidate related blocks
  2. Latency Calculation:

    • Calculate latency at channel/way/plane levels

Impact

This change enables FEMU's ZNS SSD emulation to more accurately model real hardware zone reset behavior.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

Test Configuration

sudo fio --name=zone_reset_test \
    --filename=/dev/nvme0n1 \
    --ioengine=io_uring \
    --direct=1 \
    --zonemode=zbd \
    --rw=write \
    --bs=128k \
    --iodepth=32 \
    --numjobs=10 \
    --max_open_zones=10 \
    --zone_reset_frequency=1.0 \
    --zone_reset_threshold=0.9 \
    --runtime=180 \
    --time_based \
    --group_reporting \
    --output=./result.json \
    --output-format=json

Performance Results

Metric No Delay With Delay Change
IOPS 655.66 654.14 -0.23%
Bandwidth (MB/s) 81.96 81.77 -0.23%
Avg Latency (μs) 27,309 139,355 +410%
P50 Latency (μs) 259 50 -80.73%
P99 Latency (μs) 1,115,685 4,278,190 +283%
P99.9 Latency (μs) 1,568,670 6,006,243 +283%

Analysis

  • Throughput (IOPS/Bandwidth): Negligible impact (-0.23%) - zone reset latency has minimal effect on overall throughput
  • Average Latency: ~5x increase - accurately reflects the actual cost of zone reset operations
  • Tail Latency (P99, P99.9): ~3-4x increase - properly models the real latency of requests involving zone resets

These results demonstrate more realistic ZNS SSD emulation and better reflect the performance characteristics that would occur on actual ZNS SSDs.

Test Checklist

  • I have tested my changes locally
  • I have added tests that prove my fix is effective or that my feature works
  • All existing tests pass
  • I have tested across multiple FEMU modes (if applicable)

FEMU Modes Tested

  • BlackBox SSD (BBSSD)
  • WhiteBox SSD (OCSSD)
  • Zoned Namespace SSD (ZNSSD) - Primary target
  • NoSSD
  • Not applicable

Platform Testing

  • Ubuntu 20.04/22.04
  • Other distributions (specify): ___________
  • Build verification completed

Checklist

  • My code follows QEMU coding standards
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new compiler warnings
  • I have updated documentation if necessary
  • No trailing whitespace or C++ style comments in C files

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