public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Oguz Bektas <o.bektas@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] pvestatd: fix rebalancing cpusets for cgroupv2
Date: Tue, 19 Oct 2021 14:01:07 +0200	[thread overview]
Message-ID: <1739f0c3-564e-da12-caad-30bf52d6cef6@proxmox.com> (raw)
In-Reply-To: <20211014065148.281336-1-o.bektas@proxmox.com>

tested this by running a few containers with some cores, so that the majority will be used by the containers and then setting the `lxc.cgroup2.cpuset.cpus: 9-12` option for one container and restarting said container.

Without the patch, it would not get assigned all cores set with this manual setting, if the `cores` parameter was lower. With this patch, it does get the cores assigned and other containers without fixed cores assignments are vacated to other cores.

Assuming that this is the expected behavior that this patch tries to get back for cgroups v2:

Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>

On 10/14/21 08:51, Oguz Bektas wrote:
> currently we only check the entry for cgroup v1 to decide if cores
> should be rebalanced. extend the check to include cgroup v2 entries.
> 
> reported in forum [0]
> 
> [0]: https://forum.proxmox.com/threads/hard-set-streams-for-lxc-container.97768/
> 
> Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
> ---
>   PVE/Service/pvestatd.pm | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
> index 7193388c..26d96bb2 100755
> --- a/PVE/Service/pvestatd.pm
> +++ b/PVE/Service/pvestatd.pm
> @@ -343,8 +343,9 @@ sub rebalance_lxc_containers {
>   
>   	my @cpuset_members = $cpuset->members();
>   
> -	if (!PVE::LXC::Config->has_lxc_entry($conf, 'lxc.cgroup.cpuset.cpus')) {
> -
> +	if (!PVE::LXC::Config->has_lxc_entry($conf, 'lxc.cgroup.cpuset.cpus')
> +	    && !PVE::LXC::Config->has_lxc_entry($conf, 'lxc.cgroup2.cpuset.cpus')
> +	) {
>   	    my $cores = $conf->{cores} || $cpucount;
>   	    $cores = $cpucount if $cores > $cpucount;
>   
> 




  reply	other threads:[~2021-10-19 12:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14  6:51 Oguz Bektas
2021-10-19 12:01 ` Aaron Lauterer [this message]
2021-10-20 14:47   ` [pve-devel] applied: " Thomas Lamprecht

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=1739f0c3-564e-da12-caad-30bf52d6cef6@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=o.bektas@proxmox.com \
    --cc=pve-devel@lists.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