public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Elias Huhsovitz <e.huhsovitz@proxmox.com>, pve-devel@lists.proxmox.com
Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>
Subject: Re: [PATCH qemu-server-rs v4 1/4] cpu: add pve-qemu-server-cpu crate for vCPU binding
Date: Tue, 17 Nov 2026 18:20:10 +0100	[thread overview]
Message-ID: <4f5ed842-1699-45d6-895b-e5fb664bd195@proxmox.com> (raw)
In-Reply-To: <20261111152027.260117-2-e.huhsovitz@proxmox.com>

Am 11.11.26 um 16:22 schrieb Elias Huhsovitz:
> Add a new library crate that implements vCPU to host CPU binding of qemu
> guests.
> 
> 2 main functions are exposed: gen_vcpu_bindings: (1) Reads the CPU
> Toplogy from sysfs, validates the configured cpu binding config and
> Generates a vCPU:hostCPU binding map. This function should be called
> before the guest starts. (2) bind_vcpus: Applies the binding map
> generated by gen_vcpu_bindings to the specified vm. The cpu binding is
> applied using sched_setaffinity(2).
> 
> 2 modes are implemented: (1) one-to-one: pin each vCPU to its own host
> cpu. (2) numa: bind the set of vCPUs of each vNUMA node to the set of
> CPUs of a host NUMA node. The cpu bindings are determined by the numa[N]
> configuration of the guest.
> 
> Both settings respect the configured affinity.
> 
> Thread binding uses sched_setaffinity(2), which accepts a kernel
> TID directly. The TID used is reported by qemu via query-cpus-fast.

Any rationale for why using rust here would be great, it can be fine
but it's not exactly cheap, so some sort of justification might be
nice.

Am 11.11.26 um 16:22 schrieb Elias Huhsovitz:
>  members = [
> +    "pve-qemu-server-cpu",
>      "pve-qemu-server-pci"
>  ]

applies to yours and Dominiks [pci series]: I'd rather not propagate
the naming oddity of including "server" here to rust, when we finally
got a chance of dropping some legacy decisions cheaply.
I.e., lets do at least a s/server// please, server does made really
sense in how "qemu-server" gets used nowadays.

And another thing that would be easy to do now: put these into the
qemu-server repo directly and generate a perlmod backed library
there. Each change, addition would then avoid going through an
extra repo and packaging, and qemu management is a big, important
and well enough scoped use case to justify a dedicated lib here (which
I'd not do for all repos).

Cc'ing also Fiona and Wolfgang, as IMO they should have a say in
this code architecture, where it lives and how basic core
interfaces look/work like.

[pci series]: https://lore.proxmox.com/pve-devel/20261113143939.3012964-1-d.csapak@proxmox.com/




  parent reply	other threads:[~2026-11-17 17:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 15:20 [RFC proxmox-perl-rs/qemu-server/qemu-server-rs v4 0/4] vCPU binding for qemu guests Elias Huhsovitz
2026-11-11 15:20 ` [PATCH qemu-server-rs v4 1/4] cpu: add pve-qemu-server-cpu crate for vCPU binding Elias Huhsovitz
2026-11-17 16:28   ` Dominik Csapak
2026-11-19  9:16     ` Elias Huhsovitz
2026-11-19 10:06       ` Dominik Csapak
2026-11-17 17:20   ` Thomas Lamprecht [this message]
2026-11-18  7:47     ` Dominik Csapak
2026-11-18  8:32       ` Thomas Lamprecht
2026-11-18 10:14         ` Fiona Ebner
2026-11-18 11:17           ` Elias Huhsovitz
2026-11-18 11:44             ` Thomas Lamprecht
2026-11-18 13:05               ` Elias Huhsovitz
2026-11-11 15:20 ` [PATCH proxmox-perl-rs v4 2/4] pve: cpu: add binding for pve-qemu-server-cpu crate Elias Huhsovitz
2026-11-17 16:37   ` Dominik Csapak
2026-11-11 15:20 ` [PATCH qemu-server v4 3/4] helpers: return integer values for parse_number_sets Elias Huhsovitz
2026-11-17 16:39   ` Dominik Csapak
2026-11-11 15:20 ` [PATCH qemu-server v4 4/4] cpu: add cpu binding Elias Huhsovitz
2026-11-17 16:36   ` Dominik Csapak
2026-11-19  9:35     ` Elias Huhsovitz
2026-11-19 10:07       ` Dominik Csapak
2026-11-19 13:16         ` Elias Huhsovitz
2026-11-19 17:08           ` Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f5ed842-1699-45d6-895b-e5fb664bd195@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=e.huhsovitz@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=w.bumiller@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal