Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inaccuracies in sequential cutoff promotion logic #701

Open
arutk opened this issue Apr 13, 2022 · 0 comments
Open

inaccuracies in sequential cutoff promotion logic #701

arutk opened this issue Apr 13, 2022 · 0 comments
Labels
bug Something isn't working P3-low
Milestone

Comments

@arutk
Copy link
Contributor

arutk commented Apr 13, 2022

Description

In ocf_core_seq_cutoff_update() per-queue stream information is acquired and updated under req->io_queue->seq_cutoff lock. If stream is to be promoted, the same lock is acquired again together with core seq cutoff lock. It is possible that between the two critical sections the stream is modified, possibly invalidated and/or assigned to a different address. As a result we might promote a stream that is not suitable for promotion yet.

This would not occur in non-preemptive environments (SPDK, non-preemptive Linux kernel) and, based on our analysis, shouldn't affect kernel with voluntary preemption either.

Expected Behavior

Only streams matching promotion criteria are promoted.

Actual Behavior

Theoretically possible to promote a random stream in case of parallel execution of ocf_submit() in multiple threads associated with the same I/O queue.

Steps to Reproduce

no repro steps - defect found by means of static analysis

Context

Possible Fix

Verify that stream information matches our expectation inside the second critical section.

@arutk arutk added the bug Something isn't working label Apr 13, 2022
@jfckm jfckm added the P3-low label Apr 13, 2022
@jfckm jfckm added this to the Future milestone Apr 13, 2022
@jfckm jfckm modified the milestones: Future, 22.9 Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3-low
Projects
None yet
Development

No branches or pull requests

2 participants