Skip to content

bfq: Transfer allocated request counts when moving queues - #1515

Open
ghost wants to merge 1 commit into
linus-master_basefrom
series/1195286=>linus-master
Open

ghost wants to merge 1 commit into
linus-master_basefrom
series/1195286=>linus-master

Conversation

@ghost

@ghost ghost commented Oct 28, 2026

Copy link
Copy Markdown

Pull request for series with
subject: bfq: Transfer allocated request counts when moving queues
version: 1
url: https://patchwork.kernel.org/series/1195286/

@ghost

ghost commented Oct 28, 2026

Copy link
Copy Markdown
Author

Upstream branch: d135ab4
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost

ghost commented Oct 28, 2026

Copy link
Copy Markdown
Author

Upstream branch: c339f40
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost
ghost force-pushed the series/1195286=>linus-master branch from e2feb52 to 62120bf Compare October 28, 2026 23:38
@ghost
ghost force-pushed the linus-master_base branch from 712496f to a186880 Compare October 30, 2026 13:52
@ghost

ghost commented Oct 30, 2026

Copy link
Copy Markdown
Author

Upstream branch: d89e1d1
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost
ghost force-pushed the series/1195286=>linus-master branch from 62120bf to 68c2433 Compare October 30, 2026 13:55
@ghost
ghost force-pushed the linus-master_base branch from a186880 to 46206a3 Compare November 2, 2026 17:14
@ghost

ghost commented Nov 2, 2026

Copy link
Copy Markdown
Author

Upstream branch: 6628e7d
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost
ghost force-pushed the series/1195286=>linus-master branch from 68c2433 to c3ed9eb Compare November 2, 2026 17:20
@ghost
ghost force-pushed the linus-master_base branch from 46206a3 to 220bd96 Compare November 3, 2026 23:41
@ghost

ghost commented Nov 3, 2026

Copy link
Copy Markdown
Author

Upstream branch: 05441d6
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost
ghost force-pushed the series/1195286=>linus-master branch from c3ed9eb to 97e0024 Compare November 3, 2026 23:48
@ghost
ghost force-pushed the linus-master_base branch from 220bd96 to 6c4625e Compare November 6, 2026 08:02
@ghost

ghost commented Nov 6, 2026

Copy link
Copy Markdown
Author

Upstream branch: f66469d
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost
ghost force-pushed the series/1195286=>linus-master branch from 97e0024 to 323c51f Compare November 6, 2026 08:41
@ghost
ghost force-pushed the linus-master_base branch from 6c4625e to c7f678d Compare November 7, 2026 03:08
@ghost

ghost commented Nov 7, 2026

Copy link
Copy Markdown
Author

Upstream branch: d487237
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost
ghost force-pushed the series/1195286=>linus-master branch from 323c51f to f782022 Compare November 7, 2026 03:38
@ghost
ghost force-pushed the linus-master_base branch from c7f678d to 6aa6cd1 Compare November 10, 2026 07:53
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: b3dfbde
series: https://patchwork.kernel.org/series/1195286/
version: 1

@ghost
ghost force-pushed the series/1195286=>linus-master branch from f782022 to 6dff291 Compare November 10, 2026 08:12
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: b3dfbde
series: https://patchwork.kernel.org/series/1195286/
version: 1

bfq_entity::allocated counts the requests allocated in an entity's
subtree. Request allocation increments the queue entity and its
ancestors, while request release decrements the queue entity and its
current ancestors.

When bfq_bfqq_move() moves a queue with outstanding requests to another
group, it changes entity->parent without transferring these charges.
The old ancestors retain the charges, while subsequent request releases
decrement the new ancestors even though they were never charged. This
can leave the destination group's allocated count negative and the
source group's count inflated after all requests have completed,
distorting the limits enforced by bfqq_request_over_limit().

Subtract the queue's outstanding request count from its old ancestors
before dropping the old group reference, and add it to the new ancestors
after reparenting. Leave the queue's own count unchanged. Shared
ancestors have no net change, and bfqd->lock serializes the transfer
with request accounting.

Fixes: 98f0449 ("bfq: Track number of allocated requests in bfq_entity")
Cc: stable@vger.kernel.org
Signed-off-by: sunyangkai <sunyangkai@fnnas.com>
Reviewed-by: Yu Kuai <yukuai@fygo.io>
@ghost
ghost force-pushed the series/1195286=>linus-master branch from 6dff291 to 75afba1 Compare November 10, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants