All of lore.kernel.org
 help / color / mirror / Atom feed
* Fine-grained proxy resource charging
@ 2005-08-22  5:25 John L Griffin
  2005-08-22 13:18 ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: John L Griffin @ 2005-08-22  5:25 UTC (permalink / raw)
  To: xen-devel; +Cc: rob.gardner

I am looking into how to charge a domain (say, domain "A") for the 
resources consumed by other service domains (say, B) on behalf of A.  For 
example, charging A for the CPU cycles consumed by the network I/O domain 
(B) as it processes packets produced or consumed by A.

The HP folks recently demonstrate a useful first step (see the Usenix 2005 
paper and the xen-devel post "Yet another Xen performance monitoring tool" 
on 2005-08-18): count the number of page swaps between A and B (as well as 
C and B, D and B, etc.) and use that to approximate how much of B's CPU 
usage should be assigned to A (and C, D, etc.)

I'm pursuing more cycle-accurate methods, in anticipation of non-dom0 
service domains that will do variable amounts of proxy processing, 
especially where the resources consumed (CPU, memory, I/O, larger 
primitives) are not correlated with the amount of interdomain traffic 
between A and B.  For example, a lightweight version of Resource 
Containers (Banga, OSDI 1999) or similar concepts.

The eventual goal would be for B itself to calculate and specify to Xen 
the amount of processing it does on behalf of A and other domains. Looking 
ahead, a possible next step is for Xen to expose to B whether or not A has 
already exceeded its periodic resource allocation, so any schedulers 
inside B can make smarter decisions: for example, not processing packets 
for A when A has temporarily exhausted its allocation.

There aren't many technical details yet; my objective here is to 
synchronize with anyone who's also been thinking about this particular 
problem.

-John

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <200508231916.MAA09719@viola.hpl.hp.com>]
* Re: Re: Fine-grained proxy resource charging
@ 2005-08-24 16:35 Lucy Cherkasova
  2005-08-24 17:13 ` Mark Williamson
  2005-08-25  4:56 ` John L Griffin
  0 siblings, 2 replies; 14+ messages in thread
From: Lucy Cherkasova @ 2005-08-24 16:35 UTC (permalink / raw)
  To: lucy, jlg; +Cc: xen-devel




Hi John,

Some comments to your last message:

----------------
> > I/O bandwidth is a natural extension for resource accounting and can
> > be addressed as well.
> 
> Agreed.  An interesting extension of this example: what if a non-I/O 
> privileged service domain B (say, a domain that provides a object 
> encryption service) must sometimes perform some network I/O through a 
> third domain (say, downloading a new encryption algorithm from an external 
> source) in order to continue servicing A's requests?  In this case, it 
> will need to be possible for B to transitively specify on whose behalf the 
> third-party work is being performed.

I think it might depend on the goal: if the goal is  an "accounting",
i.e. charging the domain  for the resources  it used, then one still can use
pair-wise accounting schema, and should be able to derive the transitive 
charging from the higher level relationships/agreements, or again use some
reasonable approximation (split the extra charge among all the parties using 
this encription service). Otherwise it becomes too complex (need to track  the
resource usage on the application level, and it seems beyond the Xen reach).

> 
> However, I'd already rejected the idea, and decided to concentrate on 
> alternate/finer-grained/internal-to-B approaches, for several reasons:
> 
> - Preventing DoS.  The count-page-exchanges scheme is good for CPU 
> accounting, especially since it can be done with an unmodified B. However, 
> in the context of actively rate-limiting A's resource consumption (perhaps 
> by delaying or failing the page exchanges) it wouldn't work, since by the 
> time B invokes a grant table operation it's too late -- B has already been 
> affected.

You are right, the DOS prevention and performance isolation require
a more detailed resource usage accounting. The problem is hard:
once the packet is processed by a driver (in B) and it is known which domain 
it is destined the largest potion of the work is done already... Even if 
the driver domain (B) decides do not  deliver this packet to a destination 
domain  A (due to high resource consumption on behalf of A), it can be 
somewhat late to react: B already has used a lot of resources for "half" 
processing packets on behalf of A...

----------------------------------------
> 
> > The problem gets
> > much harder and more complex when there are different drivers hosted
> > by the same driver domain.
> 
> Could anybody comment on the current status of breaking dom0 into multiple 
> single-function service domains, and/or not having a driver domain hosting 
> multiple drivers?  I'm not caught up on Xen's current events, pun 
> intended.


Yes, I would join in asking the same question: how to get a working 
configuration for multiple driver domains each hosting a single device driver?

-----------------

> Maybe it'd be 
> possible to split a driver domain into a group of cooperating 
> mini-domains, that collectively accomplish the same purpose but are 
> independently scheduled?  Each mini-domain would service exactly one 
> A-type domain.  (How bad are context switches in ring 1...maybe not too 
> bad, so the main challenge would be architecting the mini-domains.)  I'd 
> be happy to join in (from a distance) on any continuing whiteboard 
> discussions you have along these lines.
> 

I'm not sure whether this can be done, it seems that it is impossible to split
the driver domain in the "mini-domains" you describe, unless you have a separate
I/O device per each A-type domain (i.e. the devices are not shared).


Best regards, Lucy

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Re: Fine-grained proxy resource charging
@ 2005-08-24 17:34 Lucy Cherkasova
  2005-08-24 17:34 ` Mark Williamson
  0 siblings, 1 reply; 14+ messages in thread
From: Lucy Cherkasova @ 2005-08-24 17:34 UTC (permalink / raw)
  To: xen-devel, mark.williamson; +Cc: jlg, lucy



> > Yes, I would join in asking the same question: how to get a working
> > configuration for multiple driver domains each hosting a single device
> > driver?
> 
> You can only really have one domain running the actual driver.  The best 
> strategy would therefore be to keep as much IO processing as possible in 
> other domains (preferably in the guests themselves).
> 
> With user-accessible hardware (e.g. Infiniband), unprivileged guests will be 
> able to access their hardware directly using their own CPU time (and get 
> better performance in the process).  Of course Infiniband is rather expensive 
> so this won't be the most common way of doing stuff for some time (if at 
> all).
> 

Thank you, Mark.

May I rephrase the question? :
Let you have a few devices D1, D2, and D3.
Currently, in our testbed, they are all supported by Dom0 that hosts drivers 
for D1, D2, and D3.
My question is how to get a working configuration with 3 IDDs: 
IDD1 - for D1, IDD2 - for D2, IDD3 - for D3.
Any pointers are highly appreciated.

Thanks, Lucy

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Re: Fine-grained proxy resource charging
@ 2005-08-25 22:02 Lucy Cherkasova
  0 siblings, 0 replies; 14+ messages in thread
From: Lucy Cherkasova @ 2005-08-25 22:02 UTC (permalink / raw)
  To: lucy, jlg; +Cc: xen-devel


Hi John,

Here are a few comments to your  yesterday message.

> Perhaps a slightly longer-term view of performance 
> isolation is most appropriate here: assume two time quanta, Q1 and Q2, 
> where Q1 immediately precedes Q2.  Assume A has already used up its entire 
> resource allocation during Q1.  Now, if B unwittingly performs a service 
> for A during Q1 (say, accepting and processing packets from the network), 
> then perhaps A's Q2 allocation could be preemptively charged.
> 

Yes, one can design different policies for dealing with a situation described 
above....

> On a related tangent, did you and Rob do any finer-grained analysis of 
> which software components were generating the bulk of the high overheads 
> in dom0?  E.g., was it kernel time or user time; which kernel components 
> were the big offenders, etc.?  Perhaps if only a small number of 
> components are responsible for the bulk of the overhead, we can more 
> easily solve the more-accurate accounting & isolation problem by focusing 
> on only those components.

As I've mentioned in the previous message, we are working on more detailed 
accounting and instrumentation. Eventually, we plan to release it as an 
extension to the performance monitoring and profiling tool which is already 
available (xen-devel post "Yet another Xen performance monitoring tool" 
on 2005-08-18).


Best,

Lucy

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-08-25 22:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-22  5:25 Fine-grained proxy resource charging John L Griffin
2005-08-22 13:18 ` Andi Kleen
2005-08-22 15:08   ` Rob Gardner
2005-08-22 15:15     ` Andi Kleen
2005-08-22 15:28       ` Rob Gardner
2005-08-22 15:25   ` John L Griffin
2005-08-22 15:39     ` Andi Kleen
     [not found] <200508231916.MAA09719@viola.hpl.hp.com>
2005-08-23 20:36 ` John L Griffin
  -- strict thread matches above, loose matches on Subject: below --
2005-08-24 16:35 Lucy Cherkasova
2005-08-24 17:13 ` Mark Williamson
2005-08-25  4:56 ` John L Griffin
2005-08-24 17:34 Lucy Cherkasova
2005-08-24 17:34 ` Mark Williamson
2005-08-25 22:02 Lucy Cherkasova

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.