All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: Tim Deegan <tim@xen.org>
Cc: keir@xen.org, Ian.Campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, George.Dunlap@eu.citrix.com,
	andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com,
	xen-devel@lists.xen.org, will.auld@intel.com, JBeulich@suse.com,
	wei.liu2@citrix.com, dgdegra@tycho.nsa.gov
Subject: Re: Cache Allocation Technology(CAT) design for XEN
Date: Fri, 19 Dec 2014 14:09:39 +0800	[thread overview]
Message-ID: <20141219060939.GD3105@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <20141218164028.GB75015@deinos.phlegethon.org>

On Thu, Dec 18, 2014 at 05:40:28PM +0100, Tim Deegan wrote:
> Hi, 
> 
> Thanks for posting this - it's very useful.  I have a couple of
> questions about the interface design. 
Thanks Tim.
> 
> At 20:27 +0800 on 12 Dec (1418412477), Chao Peng wrote:
> > Design Overview
> > When enforcing cache allocation for VMs, the minimum granularity is
> > defined as the domain. All Virtual CPUs ("VCPUs") of a domain have the
> > same COS, and therefore, correspond to the same CBM. COS is used only in
> > hypervisor and is transparent to tool stack/user. System administrator
> > can specify the initial CBM for each domain or change it at runtime using 
> > tool stack. Hypervisor then choses a free COS to associate it with that
> > CBM or find a existed COS which has the same CBM.
> 
> What happens if there is no existing COS that matches, and all COSes
> are in use?  Does Xen return an error?  Or try to change COS->CMB
> mappings during context switches?

In the initial implementation, error is returned. It’s possible for
hypervisor to share COS for different CBMes and not to return error
here. But the problem is that COS shortage may still happen during
context switch. At that time we will have no idea for what to do. So I’d
prefer to return error directly here and leave the decision to user
space, e.g. if error is returned then it can clear CBM for some domain
and get free COS.
> 
> > - VCPU Schedule
> > When VCPU is scheduled on the physical CPU ("PCPU"), its COS value is
> > then written to MSR (IA32_PQR_ASSOC) of PCPU to notify hardware to use 
> > the new COS. The cache allocation is then enforced by hardware.
> > 
> > - Multi-Socket
> > In multi-socket environment, each VCPU may be scheduled on different
> > sockets. The hardware CAT ability(such as maximum supported COS and length
> > of CBM) maybe different among sockets. For such system, per-socket COS/CBM
> > configuration of a domain is specified. Hypervisor then use this per-socket
> > CBM information for VCPU schedule.
> 
> Is it OK to assume that in the common case all CPUs have the same CAT
> capabilities?  Then Xen can just report the smallest set of
> capabilities of any socket in the system, and the toolstack doesn't
> have to mess about with per-socket settings.
> 
> I guess you can add that syntactic sugar on the tools if you want and
> leave the more powerful hypecall interface in case it's useful. :)

Agreed, this is what I want to do. Basically the socketId is optional
for the caller. If more than one socket exists, omitting socketId means
the specified CBM applied to all sockets. While we still maintain
per-socket CBM in hypervisor internally and provide per-socket hypercall
interface in case it’s needed. In this way the interface should be user
friendly for most cases.

Chao


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2014-12-19  6:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 12:27 Cache Allocation Technology(CAT) design for XEN Chao Peng
2014-12-12 15:02 ` Andrew Cooper
2014-12-15  8:47   ` Chao Peng
2014-12-16  8:55 ` Chao Peng
2014-12-16  9:38   ` Jan Beulich
2014-12-17 11:07     ` Chao Peng
2014-12-18 17:54     ` Auld, Will
2014-12-18 16:40 ` Tim Deegan
2014-12-19  6:09   ` Chao Peng [this message]
2014-12-19  9:43     ` Tim Deegan

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=20141219060939.GD3105@pengc-linux.bj.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=will.auld@intel.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.