From nobody Tue May 21 17:47:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=edu.unito.it ARC-Seal: i=1; a=rsa-sha256; t=1659374699; cv=none; d=zohomail.com; s=zohoarc; b=N6RPjOiNtuVlTsb91duqwm9RdEn9ZYdKyd5BYx3dkJsH8cm6UNAAWbqAYamZMfY/Nt03h/Q/87gTwtCQpH0TmS1//IjPNPNJStjSsCEEMsDCrIid1Cr3GGA8R9W80yufBzgov06hGvbSoZO/tudnRqne5LcqYhJ5OlCaOrucv9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659374699; h=Content-Type:Content-Transfer-Encoding:Cc: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=u4MNOqG7TDgZyTEfRhr0+nbHQKNPHBoZibZGaDgi1lY=; b=Avs5adATDtsrtBmTm4Nx6xAmeA8rkyQvTVHswQ3Cj57+2Mqb2XiC+ggW84Vd9CEqZsIasntBnP+YbV0cQc7UoiEQ21Limeq7Hrj/bby+Zf8MKMWGEYa4aJr0GF1x4nhDsexH7DnEs90LuWRoyhiHw0VUnJjFeqAIME8F7T7L8y8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1659374699080516.8697328605218; Mon, 1 Aug 2022 10:24:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-84zz80SfPCyrl3aO9bxVrg-1; Mon, 01 Aug 2022 13:24:54 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 066378115B1; Mon, 1 Aug 2022 17:24:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6BE7492C3B; Mon, 1 Aug 2022 17:24:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2EEDC1946A6F; Mon, 1 Aug 2022 17:24:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8D27B1946A40 for ; Mon, 1 Aug 2022 17:12:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 739B82166B2A; Mon, 1 Aug 2022 17:12:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FD582166B26 for ; Mon, 1 Aug 2022 17:12:31 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5702B2999B34 for ; Mon, 1 Aug 2022 17:12:31 +0000 (UTC) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-AphT8uThPpmXW--sAY-yOQ-1; Mon, 01 Aug 2022 13:12:29 -0400 Received: by mail-ed1-f50.google.com with SMTP id z18so14593794edb.10 for ; Mon, 01 Aug 2022 10:12:29 -0700 (PDT) Received: from localhost.localdomain (host-82-54-212-97.retail.telecomitalia.it. [82.54.212.97]) by smtp.gmail.com with ESMTPSA id f5-20020a170906c08500b0072b36cbcdaasm5387863ejz.92.2022.08.01.10.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 10:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659374697; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=u4MNOqG7TDgZyTEfRhr0+nbHQKNPHBoZibZGaDgi1lY=; b=edTJc12oR6RcGjMG8KldMZxz3RKJWOd8GY6yacJ9l4fgYBVmrPL2g4uj2JvglXUqvRLqO1 p5hsypYJDUXLqe2X1wvVZWKMw2Xh48tj3KamQnynnFp9fWds7BV5om1ufb9P8zZQGewdkf TcCVbCW2/LwHVnPTIe6AiJ69rFm1qHo= X-MC-Unique: 84zz80SfPCyrl3aO9bxVrg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: AphT8uThPpmXW--sAY-yOQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u4MNOqG7TDgZyTEfRhr0+nbHQKNPHBoZibZGaDgi1lY=; b=kj3sW39BqHw46FqPLm46845GE8NKYSw0MJPAGk4pKOpKnSJS6N3eZiH8ZpBAqToxom XEUrpzuy5oFcF9ciUEhwAmnGU15ZUNs/LAwtIiKo+dMyREfpg4Kcb/i4JD4gQYIJNNuq 7qiOo2kdB2QOinK6/VeBzafbszFdHdgDpbyeEE16qqrgszg136pEXz5j/a4RbqxjhcKO wI/PBgdJdMtan6kNqclp/KABa8Qef6GgIx27lr/X5cCO1PWDR3ivySVAn/F4tFwzU7oD xAfQFVlq5U19Q7XAPx6IlNNsQkp7NZGaXJZWH6O09EaHthRe1RFbAYQ4iUDCxybvaCxl rOJA== X-Gm-Message-State: AJIora8jns6He6Qccfo9p6x0NhuiRYWzT+qwowFpCRRfaO9goy+q+2je OfwT0epgoW/P8NwCmTPofHf9fEXUD6TwsFarwrB4mV7dDfihUmx9U6CJwrJLAth+0tXh5Z9z5jr yBa4IaJlkuj2MvPqAYaoMT5GF0eW9adJi3s4BrCV0KdJNDPQFf8BfRB/iUHpO5Cg7/wa7NDeypb vSScqfbXg= X-Google-Smtp-Source: AGRyM1vmDUCm+AOAgU11hDZjWninR+5bC7UqakRabHnM5hbrxO3ggcfEduDgybKeTh4/8+cdfM8Eew== X-Received: by 2002:a05:6402:46:b0:43a:f611:5992 with SMTP id f6-20020a056402004600b0043af6115992mr17249966edu.18.1659373947800; Mon, 01 Aug 2022 10:12:27 -0700 (PDT) From: Sasha Algisi To: libvir-list@redhat.com Subject: [PATCH 1/3] virprocess: define sched_attr and sched_setattr Date: Mon, 1 Aug 2022 19:11:44 +0200 Message-Id: <20220801171146.4413-2-sasha.algisi@edu.unito.it> In-Reply-To: <20220801171146.4413-1-sasha.algisi@edu.unito.it> References: <20220801171146.4413-1-sasha.algisi@edu.unito.it> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mailman-Approved-At: Mon, 01 Aug 2022 17:24:48 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Algisi , Dario Faggioli Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659374700815100003 Content-Type: text/plain; charset="utf-8" In order to use SCHED_DEADLINE we need sched_setattr(), as sched_setscheduler() does not support all the necessary parameters. Signed-off-by: Sasha Algisi Signed-off-by: Dario Faggioli --- src/util/virprocess.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 013afd91b4..a8f86784e1 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -51,6 +51,10 @@ # include #endif =20 +#if WITH_SYS_SYSCALL_H +# include +#endif + #ifdef WIN32 # define WIN32_LEAN_AND_MEAN # include @@ -67,6 +71,10 @@ =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 +#if defined(__linux__) && !defined(SCHED_FLAG_RESET_ON_FORK) +# define SCHED_FLAG_RESET_ON_FORK 0x01 +#endif + VIR_LOG_INIT("util.process"); =20 VIR_ENUM_IMPL(virProcessSchedPolicy, @@ -79,6 +87,37 @@ VIR_ENUM_IMPL(virProcessSchedPolicy, ); =20 =20 +#if defined(__linux__) && defined(SCHED_DEADLINE) + +struct sched_attr { + uint32_t size; + uint32_t sched_policy; + uint64_t sched_flags; + + /*SCHED_OTHER, SCHED_BATCH*/ + int32_t sched_nice; + + /*SCHED_FIFO, SCHED_RR*/ + uint32_t sched_priority; + + /*SCHED_DEADLINE*/ + uint64_t sched_runtime; + uint64_t sched_deadline; + uint64_t sched_period; +}; + + +static +int sched_setattr(pid_t pid, + struct sched_attr *attr, + unsigned int flags) +{ + return syscall(SYS_sched_setattr, pid, attr, flags); +} + +#endif + + #ifndef WIN32 /** * virProcessTranslateStatus: --=20 2.37.1 --=20 ------------------------ Indirizzo istituzionale di posta elettronica=20 degli studenti e dei laureati dell'Universit=C3=A0 di TorinoOfficial=C2=A0U= niversity=20 of Turin=C2=A0email address=C2=A0for students and graduates=C2=A0 From nobody Tue May 21 17:47:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=edu.unito.it ARC-Seal: i=1; a=rsa-sha256; t=1659374696; cv=none; d=zohomail.com; s=zohoarc; b=GPsHNb0lo/jgp3gq72l1oocK3RhbB8OZk3Bx9hXqu+zdfpuJb20oXqhTyVWJvCuIjYGSYieDQtEV7vAKOr3cRawPlfl7k5RRJn7e+JKDQ3cZDk7KQ04PQPXq8ChcFMkuNAKgzuYzdQswX9yDmWF8oQMHmt1GkFbJA+/IQ0UG8y8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659374696; h=Content-Type:Content-Transfer-Encoding:Cc: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=ndq0n6mEEoCxzK0i+2vgXLdThjSXTayofTKBNVpxo7g=; b=S+MyD3udUG8h3+4aIzxxsoU93V7s65jHsiVaa/VN46LHL+dFVA4kcSY3VMSZ8rpwIVOGSoIvv9uQKouMY2HdIeGBf+R1RZh9OHFA2BaToO4/QSP8Mn3OrA1JXQCkSOiYazhC3VUWzLAqNfyrevhiAGt9dmSut7liEiZvI8BV1sg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1659374696314491.2038045975637; Mon, 1 Aug 2022 10:24:56 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-XEMtkbcDNRG-ur7UBYC0yg-1; Mon, 01 Aug 2022 13:24:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9CCCF2813D27; Mon, 1 Aug 2022 17:24:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 832A340CFD0E; Mon, 1 Aug 2022 17:24:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1CB01946A50; Mon, 1 Aug 2022 17:24:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5590A1946A40 for ; Mon, 1 Aug 2022 17:12:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4640D492CA2; Mon, 1 Aug 2022 17:12:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42714492C3B for ; Mon, 1 Aug 2022 17:12:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2655E2999B25 for ; Mon, 1 Aug 2022 17:12:34 +0000 (UTC) Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-398-EtVY2GafOkqYQqbs4vL53w-1; Mon, 01 Aug 2022 13:12:32 -0400 Received: by mail-ed1-f65.google.com with SMTP id z18so14593974edb.10 for ; Mon, 01 Aug 2022 10:12:32 -0700 (PDT) Received: from localhost.localdomain (host-82-54-212-97.retail.telecomitalia.it. [82.54.212.97]) by smtp.gmail.com with ESMTPSA id f5-20020a170906c08500b0072b36cbcdaasm5387863ejz.92.2022.08.01.10.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 10:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659374695; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ndq0n6mEEoCxzK0i+2vgXLdThjSXTayofTKBNVpxo7g=; b=eHS7/oCfbpZK2814MtLGVQQDwMtFjqu0CRu2wUfhdneote2ZLUwx8bKnffmZQi/1rHxOn3 XPVB6sktI7Q/HLxpcOC+GgqxX8KT9kn+0hPNjG4DUJO553B+EwTnroLUltCya8izf+FB0X VN2cGRv6FSyGuAp+XEivSzoVWMePF7w= X-MC-Unique: XEMtkbcDNRG-ur7UBYC0yg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: EtVY2GafOkqYQqbs4vL53w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ndq0n6mEEoCxzK0i+2vgXLdThjSXTayofTKBNVpxo7g=; b=Gc7fj8jJ8GyH9MCmSefyXvcy2zTMHnsYSs81gD3K/jrqEZ68EG3AE1Fo9CRFpWAtei dHrxHHD8x5ONbxrE3YNcWbt9wltV14zVIvKivNDsXnHTDWSbQrzuUssAqdFt3BFLrQNI M+JD/8cX5TLk0+eB/N7WVdHv3uBiOaJs832PrPpynA1ABpmDJ9yK37igkwd4oiUhC/WR W01Rlf0ajpaoNaeKHNsm8zfHTbpz07fF6c9qaHsnEJdwfs2SDP5eV6PaxWkmZJgy4vip qvCZwRqN9EoESyOuIa2LPu5WSm8dL/EV0prFEdbMMHy8digfO+ir56IFz0qBAnspxwhO dt/g== X-Gm-Message-State: AJIora99C0H8c2O/eq20Pg3ejn0zNJ9gTngqBWWAGGbSUK0wy7rzglVx JU4BW6xZWknbGMbtBR+eUYCsB7AQu2Iqfj3w1uE7OHBblI+9zuH2oOYu/L7LBYkwxxiWHJZot/9 QHsjR9RHR+t6PrA/FS4Z4y100yCN5IJHwYkWmT5nzEptSyN5iy0Hci3+LyPoKFwoKalO++fwzbN mxUMIZ X-Google-Smtp-Source: AGRyM1vVm1Zrkx9GI2ujDM20sO7eOIGBEDO3wFjEeCECAJce3sqMOqqhmJduDsCLGkVxh4qJbJb47g== X-Received: by 2002:a05:6402:484:b0:43b:6e02:71af with SMTP id k4-20020a056402048400b0043b6e0271afmr17130160edv.176.1659373951079; Mon, 01 Aug 2022 10:12:31 -0700 (PDT) From: Sasha Algisi To: libvir-list@redhat.com Subject: [PATCH 2/3] virprocess: add the SCHED_DEADLINE scheduling policy Date: Mon, 1 Aug 2022 19:11:45 +0200 Message-Id: <20220801171146.4413-3-sasha.algisi@edu.unito.it> In-Reply-To: <20220801171146.4413-1-sasha.algisi@edu.unito.it> References: <20220801171146.4413-1-sasha.algisi@edu.unito.it> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mailman-Approved-At: Mon, 01 Aug 2022 17:24:48 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Algisi , Dario Faggioli Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659374698970100001 Content-Type: text/plain; charset="utf-8" Tasks associated to virtual CPUs, IO Threads and Emulator processes can be created with the SCHED_DEADLINE policy. The policy is described in details here: https://docs.kernel.org/scheduler/sched-deadline.html It requires the following parameters (all in nanoseconds): 1) runtime 2) deadline 3) period It must always holds that: runtime <=3D deadline <=3D period. The kernel enforces that the values stay within [1024, 2^63-1]. Note, however, that a smaller range could be set (or be already set by default) via sysctl (see kernel.sched_deadline_period_max_us and kernel.sched_deadline_period_min_us). All the three parameters are mandatory but period can be set to 0, in which case it will set to the same value of deadline. Signed-off-by: Sasha Algisi Signed-off-by: Dario Faggioli --- src/ch/ch_process.c | 3 +- src/conf/domain_conf.h | 3 ++ src/qemu/qemu_process.c | 8 +++- src/util/virprocess.c | 84 +++++++++++++++++++++++++++++++++++++++-- src/util/virprocess.h | 6 ++- 5 files changed, 97 insertions(+), 7 deletions(-) diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index 77f55e777b..a40d188aac 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -293,7 +293,8 @@ virCHProcessSetupPid(virDomainObj *vm, /* Set scheduler type and priority, but not for the main thread. */ if (sched && nameval !=3D VIR_CGROUP_THREAD_EMULATOR && - virProcessSetScheduler(pid, sched->policy, sched->priority) < 0) + virProcessSetScheduler(pid, sched->policy, sched->priority, + sched->runtime, sched->deadline, sched->per= iod) < 0) goto cleanup; =20 ret =3D 0; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 060c395943..c3d1a1b65d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2454,6 +2454,9 @@ typedef enum { struct _virDomainThreadSchedParam { virProcessSchedPolicy policy; int priority; + uint64_t runtime; + uint64_t deadline; + uint64_t period; }; =20 struct _virDomainTimerCatchupDef { diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 137dcf5cf4..7586e0538a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2728,7 +2728,8 @@ qemuProcessSetupPid(virDomainObj *vm, /* Set scheduler type and priority, but not for the main thread. */ if (sched && nameval !=3D VIR_CGROUP_THREAD_EMULATOR && - virProcessSetScheduler(pid, sched->policy, sched->priority) < 0) + virProcessSetScheduler(pid, sched->policy, sched->priority, + sched->runtime, sched->deadline, sched->per= iod) < 0) goto cleanup; =20 ret =3D 0; @@ -7813,7 +7814,10 @@ qemuProcessLaunch(virConnectPtr conn, if (vm->def->cputune.emulatorsched && virProcessSetScheduler(vm->pid, vm->def->cputune.emulatorsched->policy, - vm->def->cputune.emulatorsched->priority) <= 0) + vm->def->cputune.emulatorsched->priority, + vm->def->cputune.emulatorsched->runtime, + vm->def->cputune.emulatorsched->deadline, + vm->def->cputune.emulatorsched->period) < 0) goto cleanup; =20 VIR_DEBUG("Setting any required VM passwords"); diff --git a/src/util/virprocess.c b/src/util/virprocess.c index a8f86784e1..c96bfc45fd 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -84,6 +84,7 @@ VIR_ENUM_IMPL(virProcessSchedPolicy, "idle", "fifo", "rr", + "deadline", ); =20 =20 @@ -1610,6 +1611,13 @@ virProcessSchedTranslatePolicy(virProcessSchedPolicy= policy) case VIR_PROC_POLICY_RR: return SCHED_RR; =20 + case VIR_PROC_POLICY_DEADLINE: +# ifdef SCHED_DEADLINE + return SCHED_DEADLINE; +# else + return -1; +# endif + case VIR_PROC_POLICY_LAST: /* nada */ break; @@ -1621,13 +1629,20 @@ virProcessSchedTranslatePolicy(virProcessSchedPolic= y policy) int virProcessSetScheduler(pid_t pid, virProcessSchedPolicy policy, - int priority) + int priority, + uint64_t runtime G_GNUC_UNUSED, + uint64_t deadline G_GNUC_UNUSED, + uint64_t period G_GNUC_UNUSED) { struct sched_param param =3D {0}; int pol =3D virProcessSchedTranslatePolicy(policy); =20 - VIR_DEBUG("pid=3D%lld, policy=3D%d, priority=3D%u", - (long long) pid, policy, priority); + VIR_DEBUG("pid=3D%lld, policy=3D%d, priority=3D%u, " + "runtime=3D%llu, deadline=3D%llu, period=3D%llu", + (long long) pid, policy, priority, + (unsigned long long) runtime, + (unsigned long long) deadline, + (unsigned long long) period); =20 if (!policy) return 0; @@ -1667,6 +1682,69 @@ virProcessSetScheduler(pid_t pid, param.sched_priority =3D priority; } =20 +# ifdef SCHED_DEADLINE + if (pol =3D=3D SCHED_DEADLINE) { + struct sched_attr attr =3D {0}; + /* + * The range is enforced in the kernel. + * See: https://man7.org/linux/man-pages/man7/sched.7.html + */ + uint64_t min_value =3D 1024; + uint64_t max_value =3D (1ULL << 63) - 1; + + if (runtime < min_value || runtime > max_value) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Scheduler runtime %llu out of range " + "[%llu, %llu]"), + (unsigned long long) runtime, + (unsigned long long) min_value, + (unsigned long long) max_value); + return -1; + } + + if (deadline < runtime || deadline > max_value) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Scheduler deadline %llu out of range " + "[%llu, %llu]"), + (unsigned long long) deadline, + (unsigned long long) runtime, + (unsigned long long) max_value); + return -1; + } + + if ((period < deadline || period > max_value) && period !=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Invalid scheduler period %llu, " + "possible correct values are 0 " + "or [%llu, %llu]"), + (unsigned long long) period, + (unsigned long long) deadline, + (unsigned long long) max_value); + return -1; + } + + attr.size =3D sizeof(attr); + attr.sched_policy =3D pol; + /* + * Setting reset-on-fork is necessary as SCHED_DEADLINE + * tasks cannot fork. See: + * https://docs.kernel.org/scheduler/sched-deadline.html#default-b= ehavior + */ + attr.sched_flags =3D SCHED_FLAG_RESET_ON_FORK; + attr.sched_runtime =3D runtime; + attr.sched_deadline =3D deadline; + attr.sched_period =3D period; + + if (sched_setattr(pid, &attr, 0) =3D=3D 0) { + return 0; + } else { + virReportSystemError(errno, + _("Cannot set scheduler parameters for pi= d %lld"), + (long long) pid); + return -1; + } + } +# endif if (sched_setscheduler(pid, pol, ¶m) < 0) { virReportSystemError(errno, _("Cannot set scheduler parameters for pid %l= ld"), diff --git a/src/util/virprocess.h b/src/util/virprocess.h index 30b6981c73..84fdf00fdf 100644 --- a/src/util/virprocess.h +++ b/src/util/virprocess.h @@ -33,6 +33,7 @@ typedef enum { VIR_PROC_POLICY_IDLE, VIR_PROC_POLICY_FIFO, VIR_PROC_POLICY_RR, + VIR_PROC_POLICY_DEADLINE, =20 VIR_PROC_POLICY_LAST } virProcessSchedPolicy; @@ -116,7 +117,10 @@ int virProcessSetupPrivateMountNS(void); =20 int virProcessSetScheduler(pid_t pid, virProcessSchedPolicy policy, - int priority); + int priority, + uint64_t runtime, + uint64_t deadline, + uint64_t period); =20 GStrv virProcessGetStat(pid_t pid, pid_t tid); =20 --=20 2.37.1 --=20 ------------------------ Indirizzo istituzionale di posta elettronica=20 degli studenti e dei laureati dell'Universit=C3=A0 di TorinoOfficial=C2=A0U= niversity=20 of Turin=C2=A0email address=C2=A0for students and graduates=C2=A0 From nobody Tue May 21 17:47:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=edu.unito.it ARC-Seal: i=1; a=rsa-sha256; t=1659374699; cv=none; d=zohomail.com; s=zohoarc; b=hwHHMW8SJIJCPOucM54SBwjwS5GdHhzZLFSYefHxrh/rSP/2aQDtmw6nwMkrjkbVJDapSsfn+9W+5+upCZ6TCuaTAuLECustlwgmhXPaCYAaFzGenrhE2Sckz9fUa3YbyaM1hdR43uLg36NSase8XbungMz0Z8GJJWj5bZOwwSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659374699; h=Content-Type:Content-Transfer-Encoding:Cc: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=tinIXw8ZmFkryNuYh3KtbLw1jMoAvwB//5NrA8DW9ek=; b=cWBo+Wb9f46b/hsBBDfKUZ/yG2ecJ5LnReZ0eH5WKOpTOYh5e1V9P22rEGMuM+saiFU/FKUTUMc0B9hC3zQezUDhghi5tqgAHQ+TsXJJ95EY5a62g5XdgHynhtM1QRNKIhyWM/w7fHFDnGqJhRlDkwJB2aSdiM7aJrzoSmmRz64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1659374699323600.8713584498327; Mon, 1 Aug 2022 10:24:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-lvUS95diNly2X_UKTGKyPQ-1; Mon, 01 Aug 2022 13:24:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3ED2B101161C; Mon, 1 Aug 2022 17:24:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22E7E9457F; Mon, 1 Aug 2022 17:24:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D31B71946A5D; Mon, 1 Aug 2022 17:24:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 937E31946A40 for ; Mon, 1 Aug 2022 17:12:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 78450C04482; Mon, 1 Aug 2022 17:12:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74644C1D3AD for ; Mon, 1 Aug 2022 17:12:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 564931C06900 for ; Mon, 1 Aug 2022 17:12:38 +0000 (UTC) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-331-T5iJ5rUBO32gf94zJxQwzQ-1; Mon, 01 Aug 2022 13:12:35 -0400 Received: by mail-ej1-f51.google.com with SMTP id gk3so9388035ejb.8 for ; Mon, 01 Aug 2022 10:12:35 -0700 (PDT) Received: from localhost.localdomain (host-82-54-212-97.retail.telecomitalia.it. [82.54.212.97]) by smtp.gmail.com with ESMTPSA id f5-20020a170906c08500b0072b36cbcdaasm5387863ejz.92.2022.08.01.10.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 10:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659374698; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=tinIXw8ZmFkryNuYh3KtbLw1jMoAvwB//5NrA8DW9ek=; b=K5mmCXuAH6JsxeS79FA6zzqXvOFLndsW95AvJURWyMbN1Xi9KLSFDggvv38mvYbn/xWRsx RdNY7X/fQy5tGosqHo0gEk2HnXpwZIZLeNdnulle7IpcJ6UQuqvpXlMgIs7OiS9BmgSMdl vBJ6SY2Oum+7Rnq+yxFS6QsLpAvZH9Y= X-MC-Unique: lvUS95diNly2X_UKTGKyPQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: T5iJ5rUBO32gf94zJxQwzQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tinIXw8ZmFkryNuYh3KtbLw1jMoAvwB//5NrA8DW9ek=; b=xREiQqy5F2qjUdGIhVGBM0xv6Wrq62X2Pve+42lGl2TYR1InLfzFC595pAH0DtY9n1 exzDqLCzIWEGQLBcrcb/ODhHUN9LCIh2IvEk0wmL00XMSmtP6zgh3kHATx4EtDUd0P1b Uj0dGwpw3o4gXfZY2KnVMFTpnque4U0xDDHsvAumyBTG66Sd9mm4rysnV2Hfyw5Y93AC xeJYeWelgzdHx5Z0TaYXr7qEZ2EJFPA5o1l0W6wBau9noJtw0rHw1/V/NqtP9ZT+/dOu 6bgb67Qe0AlWbOH9qlqODLoc9YvGvqXEaxlv5VeZb2a3UcdUEyD3AaqEPyYEaui051TO 3Kqw== X-Gm-Message-State: AJIora+iqpU7dKUiEnq2U8aVNk3RKydXGU/32TLYKM/uv0XQaD5p7boA H+X24QDMjICrEa34dW85Ev4kI+l4Q4NfdRujM5saNSObXB56xdxS7Zoy8lL4PZHP8uoKGv2PQL6 ZKJF5CMyORRbN3GlicR1nnMwl+zZTcz8K+SQGlYJRLT/cgEbqRVynKfidKusqzsRoFFQP++kn91 GcykLa X-Google-Smtp-Source: AGRyM1tSrlnGmAgSGa/f8UBSp9uSz8BOR+5Tjhbh5Cix+jdU0flw5/IO3zjHy8OsKTd7H4j08cbynQ== X-Received: by 2002:a17:906:2245:b0:715:7c81:e39d with SMTP id 5-20020a170906224500b007157c81e39dmr13535181ejr.262.1659373953495; Mon, 01 Aug 2022 10:12:33 -0700 (PDT) From: Sasha Algisi To: libvir-list@redhat.com Subject: [PATCH 3/3] domain_conf: add SCHED_DEADLINE support in the XML configuration Date: Mon, 1 Aug 2022 19:11:46 +0200 Message-Id: <20220801171146.4413-4-sasha.algisi@edu.unito.it> In-Reply-To: <20220801171146.4413-1-sasha.algisi@edu.unito.it> References: <20220801171146.4413-1-sasha.algisi@edu.unito.it> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mailman-Approved-At: Mon, 01 Aug 2022 17:24:48 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Algisi , Dario Faggioli Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659374700848100004 Content-Type: text/plain; charset="utf-8" Users can set SCHED_DEADLINE as a scheduling policy. For example, for setting runtime =3D 10000000, deadline =3D 15000000 and period =3D 20000000 for vcpus 0-2: ... ... Update release notes accordingly. Signed-off-by: Sasha Algisi Signed-off-by: Dario Faggioli --- NEWS.rst | 5 +++ docs/formatdomain.rst | 16 +++++++--- src/conf/domain_conf.c | 52 ++++++++++++++++++++++++++++--- src/conf/schemas/domaincommon.rng | 16 ++++++++++ 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index ef298da539..23484afdc2 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,11 @@ v8.7.0 (unreleased) =20 * **New features** =20 + * qemu: support for SCHED_DEADLINE scheduling + + Users can now use the SCHED_DEADLINE scheduling policy for tasks + associated to virtual CPUs, IO Threads and Emulator processes. + * **Improvements** =20 * **Bug fixes** diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1ed969ac3e..216262b79d 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -910,10 +910,11 @@ CPU Tuning support since 2.1.0` ``vcpusched``, ``iothreadsched`` and ``emulatorsched`` The optional ``vcpusched``, ``iothreadsched`` and ``emulatorsched`` ele= ments - specify the scheduler type (values ``batch``, ``idle``, ``fifo``, ``rr`= `) for - particular vCPU, IOThread and emulator threads respectively. For ``vcpu= sched`` - and ``iothreadsched`` the attributes ``vcpus`` and ``iothreads`` select= which - vCPUs/IOThreads this setting applies to, leaving them out sets the defa= ult. + specify the scheduler type (values ``batch``, ``idle``, ``fifo``, ``rr`= `, + ``deadline`` :since:`Since 8.7.0`) for particular vCPU, IOThread and em= ulator + threads respectively. For ``vcpusched`` and ``iothreadsched`` the attri= butes + ``vcpus`` and ``iothreads`` select which vCPUs/IOThreads this setting a= pplies + to, leaving them out sets the default. The element ``emulatorsched`` does not have that attribute. Valid ``vcp= us`` values start at 0 through one less than the number of vCPU's defined fo= r the domain. Valid ``iothreads`` values are described in the `IOThreads Allo= cation`_ @@ -923,6 +924,13 @@ CPU Tuning priority must be specified as well (and is ignored for non-real-time on= es). The value range for the priority depends on the host kernel (usually 1-= 99). :since:`Since 1.2.13` ``emulatorsched`` :since:`since 5.3.0` + For SCHED_DEADLINE (``deadline``), runtime , deadline and period must a= lso + be specified (they are ignored in other schedulers). It must always be = true + that: runtime <=3D deadline <=3D period. + The values are specified in nanoseconds. The valid range for the parame= ters + is [1024, 2^63-1] (but a smaller one can be put in place via sysctl). T= he + period can be set to 0, in which case, a period equal to the deadline is + used. ``cachetune`` :since:`Since 4.1.0` Optional ``cachetune`` element can control allocations for CPU caches u= sing the resctrl on the host. Whether or not is this supported can be gather= ed diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e85cc1f809..86ada8f147 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16693,7 +16693,10 @@ virDomainLoaderDefParseXML(virDomainLoaderDef *loa= der, static int virDomainSchedulerParseCommonAttrs(xmlNodePtr node, virProcessSchedPolicy *policy, - int *priority) + int *priority, + uint64_t *runtime, + uint64_t *deadline, + uint64_t *period) { if (virXMLPropEnum(node, "scheduler", virProcessSchedPolicyTypeFromStr= ing, VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO, @@ -16706,6 +16709,20 @@ virDomainSchedulerParseCommonAttrs(xmlNodePtr node, return -1; } =20 + if (*policy =3D=3D VIR_PROC_POLICY_DEADLINE) { + if (virXMLPropULongLong(node, "runtime", 10, VIR_XML_PROP_REQUIRED, + (unsigned long long *) runtime) < 0) + return -1; + + if (virXMLPropULongLong(node, "deadline", 10, VIR_XML_PROP_REQUIRE= D, + (unsigned long long *) deadline) < 0) + return -1; + + if (virXMLPropULongLong(node, "period", 10, VIR_XML_PROP_REQUIRED, + (unsigned long long *) period) < 0) + return -1; + } + return 0; } =20 @@ -16720,7 +16737,10 @@ virDomainEmulatorSchedParse(xmlNodePtr node, =20 if (virDomainSchedulerParseCommonAttrs(node, &sched->policy, - &sched->priority) < 0) + &sched->priority, + &sched->runtime, + &sched->deadline, + &sched->period) < 0) return -1; =20 def->cputune.emulatorsched =3D g_steal_pointer(&sched); @@ -16733,7 +16753,10 @@ virDomainSchedulerParse(xmlNodePtr node, const char *elementName, const char *attributeName, virProcessSchedPolicy *policy, - int *priority) + int *priority, + uint64_t *runtime, + uint64_t *deadline, + uint64_t *period) { g_autoptr(virBitmap) ret =3D NULL; g_autofree char *tmp =3D NULL; @@ -16755,7 +16778,8 @@ virDomainSchedulerParse(xmlNodePtr node, return NULL; } =20 - if (virDomainSchedulerParseCommonAttrs(node, policy, priority) < 0) + if (virDomainSchedulerParseCommonAttrs(node, policy, priority, + runtime, deadline, period) < 0) return NULL; =20 return g_steal_pointer(&ret); @@ -16773,10 +16797,14 @@ virDomainThreadSchedParseHelper(xmlNodePtr node, virDomainThreadSchedParam *sched =3D NULL; virProcessSchedPolicy policy =3D 0; int priority =3D 0; + uint64_t runtime =3D 0; + uint64_t deadline =3D 0; + uint64_t period =3D 0; g_autoptr(virBitmap) map =3D NULL; =20 if (!(map =3D virDomainSchedulerParse(node, elementName, attributeName, - &policy, &priority))) + &policy, &priority, &runtime, + &deadline, &period))) return -1; =20 while ((next =3D virBitmapNextSetBit(map, next)) > -1) { @@ -16792,6 +16820,9 @@ virDomainThreadSchedParseHelper(xmlNodePtr node, =20 sched->policy =3D policy; sched->priority =3D priority; + sched->runtime =3D runtime; + sched->deadline =3D deadline; + sched->period =3D period; } =20 return 0; @@ -26029,6 +26060,17 @@ virDomainSchedulerFormat(virBuffer *buf, sched->priority); break; =20 + case VIR_PROC_POLICY_DEADLINE: + virBufferAsprintf(buf, "<%ssched", name); + if (multiple_threads) + virBufferAsprintf(buf, " %ss=3D'%zu'", name, id); + virBufferAsprintf(buf, " scheduler=3D'%s' runtime=3D'%llu' dea= dline=3D'%llu' period=3D'%llu'/>\n", + virProcessSchedPolicyTypeToString(sched->pol= icy), + (unsigned long long) sched->runtime, + (unsigned long long) sched->deadline, + (unsigned long long) sched->period); + break; + case VIR_PROC_POLICY_NONE: case VIR_PROC_POLICY_LAST: break; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index c4f293a4c3..86daffab8c 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -1168,6 +1168,22 @@ + + + + deadline + + + + + + + + + + + + =20 --=20 2.37.1 --=20 ------------------------ Indirizzo istituzionale di posta elettronica=20 degli studenti e dei laureati dell'Universit=C3=A0 di TorinoOfficial=C2=A0U= niversity=20 of Turin=C2=A0email address=C2=A0for students and graduates=C2=A0