Skip to content

WIP: multi-queue support#1

Draft
guzu wants to merge 18 commits intoAnthoineB:v3.55.5-qcow2from
guzu:guzu/multi-queue
Draft

WIP: multi-queue support#1
guzu wants to merge 18 commits intoAnthoineB:v3.55.5-qcow2from
guzu:guzu/multi-queue

Conversation

@guzu
Copy link

@guzu guzu commented Jan 30, 2026

No description provided.

@guzu guzu changed the title DBG: avoid a snprintf() for each request WIP: multi-queue support Jan 30, 2026
Copy link
Owner

@AnthoineB AnthoineB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About 7d716af, my equivalent commit is 1bfa83b

Copy link
Owner

@AnthoineB AnthoineB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like commit abc7785, I can take it in first branch to upstream.

Copy link
Owner

@AnthoineB AnthoineB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On commit af29869, as the message said it won't compile, I was expecting code fixes.

#include "tapdisk-metrics.h"

#define BLKIF_MAX_QUEUES 4
#define BLKIF_MAX_GRANT_REF 8 /* TODO Why 8 specifically? */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is already defined as MAX_RING_PAGES.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These macros have been moved in common header file on another commit.
But your remark about is still valid.

#include "tapdisk-utils.h"
#include "tapdisk-metrics.h"

#define BLKIF_MAX_QUEUES 4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer not to prefix names with BLKIF_ as it could be interpreted as the official protocol. Maybe MAX_QUEUES is enough. And probably it will be better to move it in include/xen_blkif.h.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

int proto, const char *pool_name, const int minor)
tap_ctl_connect_xenblkif(const pid_t pid, const domid_t domid, const int devid,
int poll_duration, int poll_idle_threshold,
const grant_ref_t grefs[][8], const int order, const int queues,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAX_RING_PAGES instead of 8?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

#include "xen_blkif.h"

#define BLKIF_MAX_QUEUES 4
#define BLKIF_MAX_GRANT_REF 8
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to redefine those constants as frontend.c includes xen_blkif.h.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@guzu
Copy link
Author

guzu commented Feb 5, 2026

On commit af29869, as the message said it won't compile, I was expecting code fixes.

Pure C99 won't compile that's why I forced to gnu99. But my initial goal was to enforce a version mainly to be able to use boolean and int32/int64 in a standard way. C11 might be as good, but I didn't want to force for a too recent specification like C23 that might be well supported by all compilers.
We could switch to C11, so we could make use of atomics and static asserts.

I should explain that in the commit log.

@guzu guzu force-pushed the guzu/multi-queue branch 2 times, most recently from 3726e27 to 974d9cc Compare February 9, 2026 09:04
guzu and others added 18 commits February 20, 2026 09:44
When doing pause/unpause there was a memory leak related to coroutine
stack when coroutine pool are used (CONFIG_COROUTINE_POOL).

Code using QEMU threads can register a callback at thread exit, and
QEMU coroutine have local_pool_cleanup() registered for that. We just
have to use QEMU threads instead of standard pthreads to free the
stack coroutine memory.
Mainly useful for debug, and error report, but can hurt performances.
Some part of the project won't compile with ISO C99.
If tapdisk PID is not found, temporary structure must be freed.
Not a big deal, except when enabling Address Sanitizer during tests.
It is not possible list more than 7 VBD for a single tapdisk.
In real life scenario, but might be an issue for stress tests.
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.

2 participants