From nobody Fri May 3 05:40:38 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1559284373; cv=none; d=zoho.com; s=zohoarc; b=NaK+GaV1iWtx9V8b4tPb3BMRnnlccy+CWo74ZayY7QGZyQH9fTsyC+XE/jAyn3KKkR0FO0jIW+84LOUoaNjzI8AiIKem85u56q9VdunRX/vu83TSATJLtFOa75tUN4vVSZ7KSJb33xAYXA9URBeuxLHF0lHCn1/qEg02wI/II7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559284373; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=iHMsD66/5qVkRVNZupXq5E8HOE0LJBiuHKYo215BvJE=; b=YWSaQN08uX6kVYkwjPVNpTA+RMBxC/HwGNBPQikboPeO7mhmtUWEaFW2CTr/cYYQRsBRzf3T8LEPagcVPRrVr3oaRfx8Gsu4KJy9vEt/utakA3WZJ3/FKps0pXz+7TAIPWFe/au9ILvkyEEHsrGZFSYvAvMNRSy+ZaPb9Oxrhvs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1559284373159233.10353384633288; Thu, 30 May 2019 23:32:53 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hWb4U-0004I5-MC; Fri, 31 May 2019 06:31:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hWb4T-0004Hy-6o for xen-devel@lists.xenproject.org; Fri, 31 May 2019 06:31:21 +0000 Received: from mxnavi-mail.mxnavi.com (unknown [116.90.87.199]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id b1d6ccf7-836d-11e9-8980-bc764e045a96; Fri, 31 May 2019 06:31:18 +0000 (UTC) Received: from localhost.localdomain (61.161.186.150) by mxnavi-mail.mxnavi.com (116.90.87.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Fri, 31 May 2019 14:29:05 +0800 X-Inumbo-ID: b1d6ccf7-836d-11e9-8980-bc764e045a96 From: Baodong Chen To: Date: Fri, 31 May 2019 14:31:08 +0800 Message-ID: <1559284268-8280-1-git-send-email-chenbaodong@mxnavi.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [61.161.186.150] X-ClientProxiedBy: mxnavi-mail.mxnavi.com (116.90.87.199) To mxnavi-mail.mxnavi.com (116.90.87.199) Subject: [Xen-devel] [PATCH] xen: schedule: initialize 'now' when really needed X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Baodong Chen , George Dunlap , Dario Faggioli Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" when 'periodic_period' is zero, there is no need to initialize 'now'. Signed-off-by: Baodong Chen Acked-by: Dario Faggioli --- xen/common/schedule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 66f1e26..86341bc 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -1385,12 +1385,13 @@ long sched_adjust_global(struct xen_sysctl_schedule= r_op *op) =20 static void vcpu_periodic_timer_work(struct vcpu *v) { - s_time_t now =3D NOW(); + s_time_t now; s_time_t periodic_next_event; =20 if ( v->periodic_period =3D=3D 0 ) return; =20 + now =3D NOW(); periodic_next_event =3D v->periodic_last_event + v->periodic_period; =20 if ( now >=3D periodic_next_event ) --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel