Skip to content

Bug: IS_INIT.compare_exchange uses stronger memory ordering than necessary #14

@zjp-CN

Description

@zjp-CN

.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)

This is caught by AtomVChecker :

{
  "bug_kind": "AtomicCorrelationViolation",
  "possibility": "Possibly",
  "diagnosis": {
    "atomic": "percpu/src/imp.rs:59:10: 59:75"
  },
  "explanation": "Using an atomic operation with a stronger memory ordering than necessary can lead to unnecessary performance overhead.
   Using Relaxed is sufficient to ensure the correctness of the program"
}
Report

Report from os-checker & AtomVChecker:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions