From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 33EB61FF0C0 for ; Wed, 18 Nov 2026 08:48:13 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 31A6721605; Wed, 18 Nov 2026 08:48:10 +0100 (CET) Message-ID: Date: Wed, 18 Nov 2026 08:47:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH qemu-server-rs v4 1/4] cpu: add pve-qemu-server-cpu crate for vCPU binding To: Thomas Lamprecht , Elias Huhsovitz , pve-devel@lists.proxmox.com References: <20261111152027.260117-1-e.huhsovitz@proxmox.com> <20261111152027.260117-2-e.huhsovitz@proxmox.com> <4f5ed842-1699-45d6-895b-e5fb664bd195@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <4f5ed842-1699-45d6-895b-e5fb664bd195@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794988085058 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.286 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 5QDE3LAIF44XOORCXMS3YEPT5FXXGUUF X-Message-ID-Hash: 5QDE3LAIF44XOORCXMS3YEPT5FXXGUUF X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Wolfgang Bumiller X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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/