From nobody Sun Feb 8 14:59:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606317933; cv=none; d=zohomail.com; s=zohoarc; b=Ok3SEWjWJmoz3aC9kuB/5FmnqoVnuB3zfGExU47iuD3YI96CQsWIphNDrQmEO/l9KR5bG9ATuofhpS7nSU2xz7+mcookLaVQSRbqzypbYK8w7zN9SltuxIVjBbWKbiLhrfCwqfZu//cSnUjY6/9Wj6PVVBBhYeGsfEVhzSF6rAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606317933; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BRHQuevmjKbwFX3+YKRgrf33Y13x5RNBILhpjWcy4vg=; b=Ndrwz0hvupIZASt2466Y68pRQSWwtzJy3V9Zl8d41cK9DgHHAf4mDYdJ3m4PtYfyQPTCPVly5Pz1zheKnHSC0CyWZdjoY+VK1M8jP4lyhg/1VO3iQyBR52tT7z2Veb99oYrXnivUsEaNj51iNAcED7zXQIWkkCUfxuTS5KlMEnI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1606317933927770.5748753498327; Wed, 25 Nov 2020 07:25:33 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-319-YTlpkidMMzqm4Da4e0QNgw-1; Wed, 25 Nov 2020 10:25:29 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72F02C7419; Wed, 25 Nov 2020 15:25:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4622B19D9C; Wed, 25 Nov 2020 15:25:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 103FB1809CA7; Wed, 25 Nov 2020 15:25:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0APEbrjI020401 for ; Wed, 25 Nov 2020 09:37:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 383085D71B; Wed, 25 Nov 2020 14:37:53 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.192.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id A97685D6AC for ; Wed, 25 Nov 2020 14:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606317932; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=BRHQuevmjKbwFX3+YKRgrf33Y13x5RNBILhpjWcy4vg=; b=Um52VvWpy7tai8JE67ZiQeWyp/cw9ijGVpWTS33mSiJf0LNwg8Qk3E3MlF7g5emGMl+Jkq DcxgP2Rg8axYgURwESywLnfkAwlKJYKjMH8j0+BnO5H+iiG6gnEzNp0jjr3ps3IxYyjTkG 4PnIcn/FGpxznJIvVYpIU4Q7rSebzSI= X-MC-Unique: YTlpkidMMzqm4Da4e0QNgw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] vircgroup: fix cpu quota maximum limit Date: Wed, 25 Nov 2020 15:37:44 +0100 Message-Id: <0d95050aaf851def9e0a3440dd4eeb078ca738de.1606314162.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Kernel commit added proper check for cpu quota maximum limit to prevent internal overflow. Even though this change is not present in all kernels it makes sense to enforce the same limit in libvirt. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1750315 Signed-off-by: Pavel Hrdina --- src/util/vircgroup.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 2a9b341985..ec0902e301 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -233,7 +233,9 @@ int virCgroupSetupCpuShares(virCgroupPtr cgroup, unsign= ed long long shares, #define VIR_CGROUP_CPU_PERIOD_MIN 1000LL #define VIR_CGROUP_CPU_PERIOD_MAX 1000000LL #define VIR_CGROUP_CPU_QUOTA_MIN 1000LL -#define VIR_CGROUP_CPU_QUOTA_MAX 18446744073709551LL +/* Based on kernel code ((1ULL << MAX_BW_BITS) - 1) where MAX_BW_BITS is + * (64 - BW_SHIFT) and BW_SHIFT is 20 */ +#define VIR_CGROUP_CPU_QUOTA_MAX 17592186044415LL =20 int virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_pe= riod); int virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_p= eriod); --=20 2.26.2