public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	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: Wed, 18 Nov 2026 08:47:56 +0100	[thread overview]
Message-ID: <a287cbf9-b4a2-4eb8-9b2c-9776bd278c77@proxmox.com> (raw)
In-Reply-To: <4f5ed842-1699-45d6-895b-e5fb664bd195@proxmox.com>



On 11/17/26 6:20 PM, Thomas Lamprecht wrote:
> 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.
> 

This is (in part) my doing:

When talking off list with elias regarding his first versions,
the question perl or rust came up and i said that i'm in favor
of using rust vs perl, at least for new and self-contained
parts.

I chose rust for the pci stuff because the type system really
helped me out there, and if we have a place to put qemu-server
rust code, i though new stuff could go in there.

> 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.

sure of course, i just started with something and didn't get feedback
on the naming (until now) so that's fine by me

(i feared 'pve-qemu-rs' is too close to 'pve-qemu-kvm' or 'pve-qemu',
but if it's fine for you i'll change it)

> 
> 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).

sure, started fresh to not run into merge conflicts and basically
starting from a clean slate regarding build system
(which made my life easier). I'll send a new version of my
series integrating it into qemu-server repo

> 
> 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/





  reply	other threads:[~2026-11-18  7:48 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
2026-11-18  7:47     ` Dominik Csapak [this message]
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=a287cbf9-b4a2-4eb8-9b2c-9776bd278c77@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=e.huhsovitz@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@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