From nobody Mon Feb 9 17:24:27 2026 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1568198040; cv=none; d=zoho.com; s=zohoarc; b=dF3RuHlu8x4ruKC0wbcNTcAL/wa6NZMK8toUK9u+PbRmehRIRqgltCnAv70aCw0DxgSO9W4ZBgwk2h2aA/HDWMijATKwUlUyLkcJy9NRSsLuur4NmYAVfh6+y+bxah1FAb2l+7NNOb2TkDePkmn5oni4HLnuQZN+KLudshCc7+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568198040; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=LIv33cW2CctnQNdWx4B/AnSAyLUEDzYkAZQ7VMQMjAQ=; b=GkXonFywaNuJ7JjCoX3LHFoODdbgkjoysbM5WFH7EuX1kftnziuWcM7nxfyudmFJ/JqgezqSbccEzdukzcofkrGur4CLBQE/uRLI3drwkHSqlhkYcHxTqJXpuVC+BPJEp0L1AYqpKaYbMuUGusffawT6jT6rZz0NkOvsdxSCcKk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1568198040588504.8567647276443; Wed, 11 Sep 2019 03:34:00 -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 1i7zvi-0000FK-Sw; Wed, 11 Sep 2019 10:32:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7zvh-0000EQ-9u for xen-devel@lists.xenproject.org; Wed, 11 Sep 2019 10:32:53 +0000 Received: from mail-lj1-x244.google.com (unknown [2a00:1450:4864:20::244]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 77adbebe-d47f-11e9-a337-bc764e2007e4; Wed, 11 Sep 2019 10:32:35 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id a22so19511223ljd.0 for ; Wed, 11 Sep 2019 03:32:35 -0700 (PDT) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id w27sm4585275ljd.55.2019.09.11.03.32.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Sep 2019 03:32:33 -0700 (PDT) X-Inumbo-ID: 77adbebe-d47f-11e9-a337-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MxYXirbw6xPemib9KGe3LPit2WCpm5IHJxLF3QhMyss=; b=BnFZb4zkh2Vi/LyxIKfqWpTOqMoIEu6BHvmnds1YYCeXR64vHew35ijMfBsIGEzmXP +94/wYp2b/jE0XhgoFUl/6yOW7M79jWSYp2wiNCMuIjtJEDcLUrsL1nJmTeCfejTNxNk U3T57S6i/IWTHn/g3ttVmcKarb3g/iVbFdN+0EdnqvqfL4aoX1zr0/LxV7MSJR1boohY ySFnEmsTwFTT+Ferk//eheLkr7IY68wLd+M3EE64UfEnMrs7M90HFtulddvJn4o8VTLd ba9So8Tnad1hokXfYS8ty7VdNF+e3hJd9wN+DTWjar/syQmk4rUUc37PKwkQE88I6oNW nyuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MxYXirbw6xPemib9KGe3LPit2WCpm5IHJxLF3QhMyss=; b=ZKjeQz4XJmBsNp4RZet1MbNg4ppfELST+z/l2N8jSqizSzmhLhquSIwEW6ANfBR88h iFZOEUeBF0NDeh9ZJyLTJUeiii8la2Ho6O6e+XPivEdaKFQiMI5SWD73CwnEIiZY5D7W LQqGzWgbpGFkp9tHaCxDnyCtVM6xpCyZ2OKCJ8fziygeGdMkLwWXpxdFmRsheAWhPAT+ 12tVOtW4tYL0Z8WC4N24j4spS8REJrYuMAxRvFfr7vl4hgAnxDmTUb7LCuEHHb+TIvEj q79znxQdj98KO+RO5wJWpgWhrA9QU6k2lAGzT3lkfQ2vpycaKQCQKNmF+jy6U0nTjpwp rspA== X-Gm-Message-State: APjAAAXf+MqjyGgoeTRBsQzSDA+f5/U6n8TajcGPwUbQKFOA7v8Ixjg3 50yT+j/4n68dz5LI8jr/1Icjk+tf04M= X-Google-Smtp-Source: APXvYqxHC/9oq3VXTPaJPxfA6HiwbnCV8O4kfZcimSKZ+5co849oMuU2HcoQhHVnUa59R9x7sdW4KQ== X-Received: by 2002:a2e:7a03:: with SMTP id v3mr9291670ljc.138.1568197953676; Wed, 11 Sep 2019 03:32:33 -0700 (PDT) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 11 Sep 2019 13:32:18 +0300 Message-Id: <1568197942-15374-6-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568197942-15374-1-git-send-email-andrii.anisov@gmail.com> References: <1568197942-15374-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 5/9] tacc: Introduce a lockless interface for guest time 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: Tim Deegan , Stefano Stabellini , Andrii Anisov , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Dario Faggioli , Julien Grall , Jan Beulich MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Andrii Anisov The lockless interface to acquire guest time by scheduling code is introduced. It can be used by schedulers what do not require guest time from a different pcpu to take scheduling decission. Signed-off-by: Andrii Anisov --- xen/common/schedule.c | 10 ++++++++++ xen/include/xen/sched.h | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 2007034..62df77e 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -1643,6 +1643,16 @@ void tacc_irq_exit(int place) tacc->irq_cnt--; } =20 +s_time_t tacc_get_guest_time(struct tacc *tacc) +{ + s_time_t guest_time; + + guest_time =3D tacc->state_time[TACC_GUEST]; + guest_time +=3D tacc->state_time[TACC_GSYNC]; + + return guest_time; +} + void context_saved(struct vcpu *prev) { /* Clear running flag /after/ writing context to memory. */ diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 8167608..5b41805 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -266,6 +266,8 @@ struct vcpu =20 struct evtchn_fifo_vcpu *evtchn_fifo; =20 + s_time_t pcpu_guest_time; + /* vPCI per-vCPU area, used to store data for long running operations.= */ struct vpci_vcpu vpci; =20 @@ -1033,6 +1035,12 @@ DECLARE_PER_CPU(struct tacc, tacc); void tacc_hyp(int place); void tacc_idle(int place); =20 +s_time_t tacc_get_guest_time(struct tacc *tacc); +inline s_time_t tacc_get_guest_time_delta(void) +{ + return tacc_get_guest_time(&this_cpu(tacc)) - current->pcpu_guest_time; +} + #endif /* __SCHED_H__ */ =20 /* --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel