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

scst_lib: Improve scst_put_acg() #183

Merged
merged 3 commits into from
Jul 21, 2023
Merged

scst_lib: Improve scst_put_acg() #183

merged 3 commits into from
Jul 21, 2023

Conversation

lnocturno
Copy link
Contributor

No description provided.

create_workqueue() was replaced with alloc_workqueue() with max_active set
to 0. However, the original create_workqueue() implicitly set max_active
to 1.

This change has led to unexpected bugs because previously, work items
could only be executed one by one. With the change, they can now be
executed simultaneously.

This patch fixes the issue by restoring max_active to 1.

Fixes: f4686e9 ("scst: Remove deprecated create_workqueue()")
Fixes: #179
According to kernel documentation, this flag should be set if the
workqueue will be involved in the kernel's memory reclamation flow.
Since it is not, there is no need for the driver's WQ to have this
flag set so remove it.
This patch refactors scst_put_acg() to directly call kref_put() with a
release callback that handles removal of scst_acg from the workqueue.
This replaces the previous approach of queuing a work item for each
kref_put() call, improving efficiency by reducing the number of queued
work items.
@lnocturno lnocturno merged commit c00af8a into master Jul 21, 2023
@lnocturno lnocturno deleted the gleb/3.8/fix_free_acg branch July 21, 2023 07:38
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